From 2edfd00b5c93ae62ac29ad88c56c5be271f8eaa4 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Mon, 10 Mar 2025 11:29:34 +0700 Subject: [PATCH 1/2] feat: provide monitoring-related configurations In accordance with https://github.com/getsentry/sentry-docs/pull/12660 --- docker-compose.yml | 4 ++++ relay/config.example.yml | 11 +++++++++++ sentry/sentry.conf.example.py | 18 ++++++++++++++++++ symbolicator/config.example.yml | 7 +++++++ 4 files changed, 40 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 9d8ee5a9e4..75a86e2e59 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,6 +84,10 @@ x-snuba-defaults: &snuba_defaults # Leaving the value empty to just pass whatever is set # on the host system (or in the .env file) SENTRY_EVENT_RETENTION_DAYS: + # If you have statsd server, you can utilize that to monitor self-hosted Snuba containers. + # To start, state these environment variables below on your `.env.` file and adjust the options as needed. + SNUBA_STATSD_HOST: # Example value: "100.100.123.123". Must be an IP address, not domain name + SNUBA_STATSD_PORT: # Example value: 8125 services: smtp: <<: *restart_policy diff --git a/relay/config.example.yml b/relay/config.example.yml index f73e45acca..08419297d3 100644 --- a/relay/config.example.yml +++ b/relay/config.example.yml @@ -18,3 +18,14 @@ processing: # # health: # max_memory_percent: 1.0 + +# If you have statsd server, you can utilize that to monitor self-hosted Relay. +# To start, uncomment the following line and adjust the options as needed. +# +# 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 diff --git a/sentry/sentry.conf.example.py b/sentry/sentry.conf.example.py index 98e7a6c0fb..913255918f 100644 --- a/sentry/sentry.conf.example.py +++ b/sentry/sentry.conf.example.py @@ -396,3 +396,21 @@ def get_internal_network(): # to allow specific hosts. It might be IP addresses or domain names (without `http://` or `https://`). # SENTRY_OPTIONS["relay.span-normalization.allowed_hosts"] = ["example.com", "192.168.10.1"] + +############## +# Monitoring # +############## + +# By default, Sentry uses dummy statsd monitoring backend that is a no-op. +# If you have a statsd server, you can utilize that to monitor self-hosted +# Sentry for "sentry"-related containers. +# +# To start, uncomment the following line and adjust the options as needed. + +# 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." diff --git a/symbolicator/config.example.yml b/symbolicator/config.example.yml index 62cf9b83b7..40333d7213 100644 --- a/symbolicator/config.example.yml +++ b/symbolicator/config.example.yml @@ -6,3 +6,10 @@ logging: metrics: statsd: null sentry_dsn: null # TODO: Automatically fill this with the internal project DSN + +# If you have statsd server, you can utilize that to monitor self-hosted Symbolicator. +# To start, uncomment the following line and adjust the options as needed. +# +# 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" From 9d6c275bf5c311ebd5bfe7e26d96f49f1cf901e1 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Mon, 10 Mar 2025 12:37:53 +0700 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Amin Vakil --- relay/config.example.yml | 2 +- sentry/sentry.conf.example.py | 2 +- symbolicator/config.example.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/relay/config.example.yml b/relay/config.example.yml index 08419297d3..f1a239de49 100644 --- a/relay/config.example.yml +++ b/relay/config.example.yml @@ -23,7 +23,7 @@ processing: # To start, uncomment the following line and adjust the options as needed. # # metrics: -# statsd: "100.100.123.123:8125" # It's recommended to use IP address instead of domain name +# statsd: "100.100.123.123:8125" # It is 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. diff --git a/sentry/sentry.conf.example.py b/sentry/sentry.conf.example.py index 913255918f..78bd392d11 100644 --- a/sentry/sentry.conf.example.py +++ b/sentry/sentry.conf.example.py @@ -409,7 +409,7 @@ def get_internal_network(): # 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 +# 'host': '100.100.123.123', # It is 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 diff --git a/symbolicator/config.example.yml b/symbolicator/config.example.yml index 40333d7213..de716de8c4 100644 --- a/symbolicator/config.example.yml +++ b/symbolicator/config.example.yml @@ -11,5 +11,5 @@ sentry_dsn: null # TODO: Automatically fill this with the internal project DSN # To start, uncomment the following line and adjust the options as needed. # # metrics: -# statsd: "100.100.123.123:8125" # It's recommended to use IP address instead of domain name +# statsd: "100.100.123.123:8125" # It is recommended to use IP address instead of domain name # prefix: "sentry.symbolicator" # Adjust this to your needs, default is "symbolicator"