getsentry / self-hosted

Sentry, feature-complete and packaged up for low-volume deployments and proofs-of-concept
https://develop.sentry.dev/self-hosted/
Other
7.87k stars 1.77k forks source link

Metrics Backend Not Working (statsd) #3310

Closed jquick closed 1 month ago

jquick commented 1 month ago

Self-Hosted Version

24.9.0.dev0

CPU Architecture

aarch64

Docker Version

26.1.4

Docker Compose Version

2.27.1

Steps to Reproduce

Setup self-hosted install Add statsd service to docker compose (used vector) Update sentry.conf.py to enable metrics:

SENTRY_METRICS_BACKEND = 'sentry.metrics.statsd.StatsdMetricsBackend'
SENTRY_METRICS_OPTIONS = {
    'host': 'vector',
    'port': 8125,
}

Metrics are not showing up/being sent. I can go onto one of the sentry containers and manually send metrics via:

echo "deploys.test.myservice:1|c" | nc -w 1 vector 8125

This works as expected so connectivity looks to be fine.

I've been over the documentation but am confused on what may be wrong or If there are additional steps needed to enable metrics.

Thanks for your help!

Expected Result

Metrics start sending when backend is configured

Actual Result

Nothing is sent from what I can tell

Event ID

No response

jquick commented 1 month ago

I fixed this. Sentry statsd is sent over UDP and not TCP. This was my mistake. It is working as expected now.