mirror of
https://github.com/getsentry/self-hosted.git
synced 2026-02-06 10:57:17 +00:00
feat: statsd configuration through environment variables (#4031)
* feat: statsd configuration through environment variables * feat: provide statsd config via environment variables for relay and symbolicator * fix: default statsd value to localhost * Update sentry/sentry.conf.example.py
This commit is contained in:
parent
275e7d032c
commit
fe477b41d9
5
.env
5
.env
@ -26,3 +26,8 @@ HEALTHCHECK_FILE_RETRIES=3
|
|||||||
HEALTHCHECK_FILE_START_PERIOD=600s
|
HEALTHCHECK_FILE_START_PERIOD=600s
|
||||||
# Set SETUP_JS_SDK_ASSETS to 1 to enable the setup of JS SDK assets
|
# Set SETUP_JS_SDK_ASSETS to 1 to enable the setup of JS SDK assets
|
||||||
# SETUP_JS_SDK_ASSETS=1
|
# SETUP_JS_SDK_ASSETS=1
|
||||||
|
#
|
||||||
|
# Sentry (and its' surrounding services) uses Statsd for metrics collection.
|
||||||
|
# It's also the proper way to monitor self-hosted Sentry systems.
|
||||||
|
# Set STATSD_ADDR to a valid IP:PORT combination to enable Statsd metrics collection.
|
||||||
|
# STATSD_ADDR=127.0.0.1:8125
|
||||||
|
|||||||
@ -69,6 +69,7 @@ x-sentry-defaults: &sentry_defaults
|
|||||||
SENTRY_EVENT_RETENTION_DAYS:
|
SENTRY_EVENT_RETENTION_DAYS:
|
||||||
SENTRY_MAIL_HOST:
|
SENTRY_MAIL_HOST:
|
||||||
SENTRY_MAX_EXTERNAL_SOURCEMAP_SIZE:
|
SENTRY_MAX_EXTERNAL_SOURCEMAP_SIZE:
|
||||||
|
SENTRY_STATSD_ADDR: "${STATSD_ADDR:-}"
|
||||||
volumes:
|
volumes:
|
||||||
- "sentry-data:/data"
|
- "sentry-data:/data"
|
||||||
- "./sentry:/etc/sentry"
|
- "./sentry:/etc/sentry"
|
||||||
@ -96,8 +97,7 @@ x-snuba-defaults: &snuba_defaults
|
|||||||
SENTRY_EVENT_RETENTION_DAYS:
|
SENTRY_EVENT_RETENTION_DAYS:
|
||||||
# If you have statsd server, you can utilize that to monitor self-hosted Snuba containers.
|
# 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.
|
# 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_ADDR: "${STATSD_ADDR:-}"
|
||||||
SNUBA_STATSD_PORT: # Example value: 8125
|
|
||||||
services:
|
services:
|
||||||
smtp:
|
smtp:
|
||||||
<<: *restart_policy
|
<<: *restart_policy
|
||||||
@ -466,6 +466,8 @@ services:
|
|||||||
symbolicator:
|
symbolicator:
|
||||||
<<: *restart_policy
|
<<: *restart_policy
|
||||||
image: "$SYMBOLICATOR_IMAGE"
|
image: "$SYMBOLICATOR_IMAGE"
|
||||||
|
environment:
|
||||||
|
SYMBOLICATOR_STATSD_ADDR: ${STATSD_ADDR:-127.0.0.1:8125}
|
||||||
command: run -c /etc/symbolicator/config.yml
|
command: run -c /etc/symbolicator/config.yml
|
||||||
volumes:
|
volumes:
|
||||||
- "sentry-symbolicator:/data"
|
- "sentry-symbolicator:/data"
|
||||||
@ -700,6 +702,8 @@ services:
|
|||||||
relay:
|
relay:
|
||||||
<<: *restart_policy
|
<<: *restart_policy
|
||||||
image: "$RELAY_IMAGE"
|
image: "$RELAY_IMAGE"
|
||||||
|
environment:
|
||||||
|
RELAY_STATSD_ADDR: ${STATSD_ADDR:-127.0.0.1:8125}
|
||||||
volumes:
|
volumes:
|
||||||
- type: bind
|
- type: bind
|
||||||
read_only: true
|
read_only: true
|
||||||
@ -726,6 +730,7 @@ services:
|
|||||||
TASKBROKER_KAFKA_CLUSTER: "kafka:9092"
|
TASKBROKER_KAFKA_CLUSTER: "kafka:9092"
|
||||||
TASKBROKER_KAFKA_DEADLETTER_CLUSTER: "kafka:9092"
|
TASKBROKER_KAFKA_DEADLETTER_CLUSTER: "kafka:9092"
|
||||||
TASKBROKER_DB_PATH: "/opt/sqlite/taskbroker-activations.sqlite"
|
TASKBROKER_DB_PATH: "/opt/sqlite/taskbroker-activations.sqlite"
|
||||||
|
TASKBROKER_STATSD_ADDR: ${STATSD_ADDR:-127.0.0.1:8125}
|
||||||
volumes:
|
volumes:
|
||||||
- sentry-taskbroker:/opt/sqlite
|
- sentry-taskbroker:/opt/sqlite
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -794,6 +799,7 @@ services:
|
|||||||
# Separated by commas. Leaving this unset will default to the systems dns
|
# Separated by commas. Leaving this unset will default to the systems dns
|
||||||
# resolver.
|
# resolver.
|
||||||
#UPTIME_CHECKER_HTTP_CHECKER_DNS_NAMESERVERS: "8.8.8.8,8.8.4.4"
|
#UPTIME_CHECKER_HTTP_CHECKER_DNS_NAMESERVERS: "8.8.8.8,8.8.4.4"
|
||||||
|
UPTIME_CHECKER_STATSD_ADDR: ${STATSD_ADDR:-127.0.0.1:8125}
|
||||||
depends_on:
|
depends_on:
|
||||||
kafka:
|
kafka:
|
||||||
<<: *depends_on-healthy
|
<<: *depends_on-healthy
|
||||||
|
|||||||
@ -27,9 +27,9 @@ processing:
|
|||||||
# If you have statsd server, you can utilize that to monitor self-hosted Relay.
|
# If you have statsd server, you can utilize that to monitor self-hosted Relay.
|
||||||
# To start, uncomment the following `metrics` section and adjust the options as needed.
|
# To start, uncomment the following `metrics` section and adjust the options as needed.
|
||||||
#
|
#
|
||||||
# metrics:
|
metrics:
|
||||||
# statsd: "100.100.123.123:8125" # It is recommended to use IP address instead of domain name
|
statsd: "${RELAY_STATSD_ADDR}"
|
||||||
# prefix: "sentry.relay" # Adjust this to your needs, default is "sentry.relay"
|
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
|
# sample_rate: 1.0 # Adjust this to your needs, default is 1.0
|
||||||
# # `periodic_secs` is the interval for periodic metrics emitted from Relay.
|
# # `periodic_secs` is the interval for periodic metrics emitted from Relay.
|
||||||
# # Setting it to `0` seconds disables the periodic metrics.
|
# # Setting it to `0` seconds disables the periodic metrics.
|
||||||
|
|||||||
@ -521,10 +521,14 @@ JS_SDK_LOADER_DEFAULT_SDK_URL = "https://browser.sentry-cdn.com/%s/bundle%s.min.
|
|||||||
#
|
#
|
||||||
# To start, uncomment the following line and adjust the options as needed.
|
# To start, uncomment the following line and adjust the options as needed.
|
||||||
|
|
||||||
# SENTRY_METRICS_BACKEND = 'sentry.metrics.statsd.StatsdMetricsBackend'
|
SENTRY_STATSD_ADDR = env("SENTRY_STATSD_ADDR")
|
||||||
# SENTRY_METRICS_OPTIONS: dict[str, Any] = {
|
if SENTRY_STATSD_ADDR:
|
||||||
# 'host': '100.100.123.123', # It is recommended to use IP address instead of domain name
|
host, _, port = SENTRY_STATSD_ADDR.partition(":")
|
||||||
# 'port': 8125,
|
port = int(port or 8125)
|
||||||
# }
|
SENTRY_METRICS_BACKEND = 'sentry.metrics.statsd.StatsdMetricsBackend'
|
||||||
|
SENTRY_METRICS_OPTIONS: dict[str, Any] = {
|
||||||
|
'host': host,
|
||||||
|
'port': port,
|
||||||
|
}
|
||||||
# SENTRY_METRICS_SAMPLE_RATE = 1.0 # Adjust this to your needs, default is 1.0
|
# 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."
|
# SENTRY_METRICS_PREFIX = "sentry." # Adjust this to your needs, default is "sentry."
|
||||||
|
|||||||
@ -3,13 +3,10 @@ cache_dir: "/data"
|
|||||||
bind: "0.0.0.0:3021"
|
bind: "0.0.0.0:3021"
|
||||||
logging:
|
logging:
|
||||||
level: "warn"
|
level: "warn"
|
||||||
metrics:
|
|
||||||
statsd: null
|
|
||||||
sentry_dsn: null # TODO: Automatically fill this with the internal project DSN
|
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.
|
# 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: "${SYMBOLICATOR_STATSD_ADDR}" # It is recommended to use IP address instead of domain name
|
||||||
# metrics:
|
prefix: "sentry.symbolicator" # Adjust this to your needs, default is "symbolicator"
|
||||||
# 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"
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user