docker-compose service discovery

21 views
Skip to first unread message

Júlio Falbo

unread,
May 18, 2020, 2:19:58 PM5/18/20
to Prometheus Users

"I have a Prometheus setup that monitors metrics exposed by my own services. This works fine for a single instance, but once I start scaling them, Prometheus gets completely confused and starts tracking incorrect values.

All services are running on a single node, through docker-compose.

This is the job in the scrape_configs:

  - job_name: 'wowanalyzer'
    static_configs:
    - targets: ['prod:8000']

Each instance of prod tracks metrics in its memory and serves it at /metrics. I'm guessing Prometheus picks a random container each time it scraps which leads to the huge increase in counts recorded, building up over time. Instead, I'd like Prometheus to read /metrics on all instances simultaneously, regardless of the number of instances active at that time."


Reference: https://stackoverflow.com/questions/53308951/with-prometheus-how-to-monitor-a-scaled-docker-service-where-each-instance-serve


This question was made almost 2 years ago and have no solution. I think this feature would be really nice and useful!

Júlio Falbo

unread,
May 20, 2020, 10:07:55 AM5/20/20
to Prometheus Users
So, since I didn't receive any idea and didn't find any solution, I created a tool that helps us with this issue: https://github.com/juliofalbo/docker-compose-prometheus-service-discovery
Reply all
Reply to author
Forward
0 new messages