-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
docs(self-hosted): monitor self-hosted instance #12660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c7ace0e
docs(self-hosted): monitor self-hosted instance
aldy505 e9679a3
docs(self-hosted): specify IP address for host instead of domain name
aldy505 3d41c60
Apply suggestions from code review
aldy505 752ba76
docs(self-hosted): pick side on statsd
aldy505 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| --- | ||
| title: Self-Hosted Monitoring | ||
| sidebar_title: Monitoring | ||
| sidebar_order: 10 | ||
| --- | ||
|
|
||
| <Alert title="Important" level="warning"> | ||
| These are community-contributed docs. Sentry does not officially provide support for self-hosted configurations beyond the default install. | ||
| </Alert> | ||
|
|
||
| This page is considered experimental because everyone will have different setup and requirements for their monitoring system. It is also best to use your existing monitoring system, and try to integrate Sentry with it, instead of spinning up a new one. | ||
|
|
||
| Most containers have a `statsd` client that you can point to your monitoring system. If you have a native `statsd` server instance, you can directly use it. If you don't, you might want to add some kind of converter that converts the ingested `statsd` format into your own. For example, if you are using Prometheus, you can use [prometheus-statsd-exporter](https://github.com/prometheus/statsd_exporter) to bridge the gap. | ||
|
|
||
| If you are using DataDog as your monitoring system, it is recommended to use [DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) as the collector. | ||
|
|
||
| We recommend [the original `statsd` server made by Etsy](https://github.com/statsd/statsd) or the others on the [server re-implementations](https://github.com/statsd/statsd/blob/master/docs/server_implementations.md). | ||
|
|
||
| Sentry does not provide any alerts if your host instance is low on resources such as free memory or disk space. You will need to configure this own your own relative to your needs. It is critical for you to monitor the disk space as once it gets full, it will be much harder to recover from there. | ||
|
|
||
| <Alert title="Note"> | ||
| After changing configuration files, don't forget to restart the containers with `docker compose restart`. See the <Link to="/self-hosted/#configuration">configuration section</Link> for more information. | ||
| </Alert> | ||
|
|
||
| ## Sentry-related configurations | ||
|
|
||
| This documentation assumes `100.100.123.123` as your statsd host IP address. On most services, it is recommended to provide an IP address for the host like this, instead of a domain name like `statsd.yourcompany.com`. | ||
|
|
||
| ### Sentry | ||
|
|
||
| You can configure Sentry to send metrics to Statsd server by configuring your `sentry/sentry.conf.py` file: | ||
|
|
||
| ```python | ||
| SENTRY_METRICS_BACKEND = 'sentry.metrics.statsd.StatsdMetricsBackend' | ||
| SENTRY_METRICS_OPTIONS: dict[str, Any] = { | ||
| 'host': '100.100.123.123', # It's recommended to use IP address instead of domain name | ||
| 'port': 8125, | ||
| } | ||
| # SENTRY_METRICS_SAMPLE_RATE = 1.0 # Adjust this to your needs, default is 1.0 | ||
| # SENTRY_METRICS_PREFIX = "sentry." # Adjust this to your needs, default is "sentry." | ||
| ``` | ||
|
|
||
| ### Snuba | ||
|
|
||
| You can configure Snuba to send metrics to Statsd server by configuring your `docker-compose.yml` file: | ||
|
|
||
| ```yaml | ||
| # The rest of your Docker Compose file | ||
|
|
||
| x-snuba-defaults: &snuba_defaults | ||
| <<: *restart_policy | ||
| depends_on: | ||
| clickhouse: | ||
| <<: *depends_on-healthy | ||
| kafka: | ||
| <<: *depends_on-healthy | ||
| redis: | ||
| <<: *depends_on-healthy | ||
| image: "$SNUBA_IMAGE" | ||
| environment: | ||
| SNUBA_SETTINGS: self_hosted | ||
| CLICKHOUSE_HOST: clickhouse | ||
| DEFAULT_BROKERS: "kafka:9092" | ||
| REDIS_HOST: redis | ||
| UWSGI_MAX_REQUESTS: "10000" | ||
| UWSGI_DISABLE_LOGGING: "true" | ||
| # Leaving the value empty to just pass whatever is set | ||
| # on the host system (or in the .env file) | ||
| SENTRY_EVENT_RETENTION_DAYS: | ||
| SNUBA_STATSD_HOST: "100.100.123.123" # Must be an IP address, not domain name | ||
| SNUBA_STATSD_PORT: 8125 | ||
|
|
||
| # The rest of your Docker Compose file | ||
| ``` | ||
|
|
||
| ### Relay | ||
|
|
||
| You can configure Relay to send metrics to Statsd server by configuring your `relay/config.yml` file: | ||
|
|
||
| ```yaml | ||
| # The rest of your config.yml file | ||
| metrics: | ||
| statsd: "100.100.123.123:8125" # It's recommended to use IP address instead of domain name | ||
| # prefix: "sentry.relay" # Adjust this to your needs, default is "sentry.relay" | ||
| # sample_rate: 1.0 # Adjust this to your needs, default is 1.0 | ||
| # `periodic_secs` is the interval for periodic metrics emitted from Relay. | ||
| # Setting it to `0` seconds disables the periodic metrics. | ||
| # periodic_secs: 5 | ||
| ``` | ||
|
|
||
| ### Symbolicator | ||
|
|
||
| You can configure Symbolicator to send metrics to Statsd server by configuring your `symbolicator/config.yml` file: | ||
|
|
||
| ```yaml | ||
| # The rest of your config.yml file | ||
| metrics: | ||
| statsd: "100.100.123.123:8125" # It's recommended to use IP address instead of domain name | ||
| prefix: "sentry.symbolicator" # Adjust this to your needs, default is "symbolicator" | ||
| ``` | ||
|
|
||
| ## Sentry dependencies | ||
|
|
||
| We don't provide configurations for Sentry's dependencies such as PostgreSQL, Kafka, Redis, Memcached and ClickHouse that are bundled with the Docker Compose file. You will need to provide monitoring configuration for those service yourself adjusted to your needs. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.