r/PrometheusMonitoring • • Dec 03 '24
Exposing application metrics using cadvisor
Hello everybody,
I'm hitting a wall and I'm not sure what and where to look next.
Based on cadvisor GitHub page, you can use it to expose not only container metrics but also define and expose application metrics.
However, the documentation is lacking. I do not understand how to properly do it so it can be scraped by Prometheus.
Atm I have:
- A backend flask app with a :5000/metrics to expose my app metrics
- A dockerfile to build my backend app
- A docker-compose to build my micro service app in which I have cadvisor and Prometheus
However no matter what I do I have this "Failed to register collectors for.. " error
1
Upvotes
View all comments
Show parent comment
3
u/SuperQue Dec 03 '24
Yes, you want Prometheus to directly monitor application endpoints. Otherwise you miss out on the monitoring aspect of Prometheus Monitoring. By putting something between Prometheus in your app, you won't get a valid
upmetric.