Skip to content
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

Metrics are not flushed to graphite #729

Open
ChristianKniep opened this issue Aug 28, 2024 · 0 comments
Open

Metrics are not flushed to graphite #729

ChristianKniep opened this issue Aug 28, 2024 · 0 comments

Comments

@ChristianKniep
Copy link

Hey there, I am using the following docker-compose file to run the stack.

services:
 gostatsd:
  image: atlassianlabs/gostatsd:39.1.12
  command:
   - --config-path
   - /etc/gostatsd/config.toml
   - --log-raw-metric
   - --flush-interval=30s
   - --verbose
  ports:
    - "8125:8125/udp"
    - "8126:8126"
    - "8181:8181"
  volumes:
   - ./config.toml:/etc/gostatsd/config.toml:ro
 graphite:
  image: sitespeedio/graphite
  ports:
    - "8080:80"
    - "8001:8000"
    - "2003:2003"
    - "2004:2004"
    - "7002:7002"
  volumes:
    - ./data/graphite:/opt/graphite/storage/whisper
 grafana:
  image: grafana/grafana
  ports:
    - "3000:3000"
#  volumes:
#    - ./data/grafana:/var/lib/grafana
  environment:
    - GF_SECURITY_ADMIN_PASSWORD=admin

The config is as follows:

server-mode='standalone'
statser-type='null'
flush-interval='1s'
backends=['graphite']
[graphite]
address = "graphite:2003"
dial_timeout = '3s'
write_timeout = '10s'
mode = 'tags'
global_prefix = 'd'
prefix_counter = 'counters'
prefix_timer = 'timers'
prefix_gauge = 'gauges'
prefix_sets = 'sets'

I can send metrics to statsd...

while [ true ];do sleep 2;echo "foo.gauge:${RANDOM}|g"   | nc -u -w0 localhost 8125;done

.. they'll show up in the logs

$ docker-compose up gostatsd
[+] Running 1/0
 ✔ Container build-gostatsd-1  Created                                                                                                                                                                                                                                                                                                                                                                                                                        0.0s
Attaching to gostatsd-1
gostatsd-1  | time="2024-08-28T12:05:50Z" level=info msg="Starting server"
gostatsd-1  | time="2024-08-28T12:05:50Z" level=info msg="No cloud provider specified"
gostatsd-1  | time="2024-08-28T12:05:50Z" level=info msg="created backend" address="graphite:2003" backend=graphite counter-namespace=d.counters dial-timeout=3s gauges-namespace=d.gauges global-suffix= mode=tags sets-namespace=d.sets timer-namespace=d.timers write-timeout=10s
gostatsd-1  | time="2024-08-28T12:05:50Z" level=info msg="Initialised backend" backend=graphite
gostatsd-1  | time="2024-08-28T12:06:07Z" level=info msg="[{gauge, foo.gauge, 21489.000000, , }]"
gostatsd-1  | time="2024-08-28T12:06:09Z" level=info msg="[{gauge, foo.gauge, 21489.000000, , }]"
gostatsd-1  | time="2024-08-28T12:06:11Z" level=info msg="[{gauge, foo.gauge, 21489.000000, , }]"

I even see statsd internal metrics that metrics are received in Graphite.
Screenshot 2024-08-28 at 14 28 24

I am also able to send metrics to graphite from within the gostatsd container.

 docker exec -ti $(docker ps -ql) ash
/ # echo "local.random.diceroll2 4 `date +%s`" |nc graphite 2003

But I can not find any statsd metrics I send to statsd ( the foo.gauge).

Someone has an idea what I miss?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant