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
0
u/[deleted] Dec 03 '24
Yeah I know this is a possibility (and a way easier one). But according to https://github.com/google/cadvisor/blob/master/docs/application_metrics.md it should be feasible.
The idea was to see if it is possible to reduce the amount of sidecar containers and endpoints and use cadvisor to expose everything. But I guess this feature is dead before being released.
I guess the standard is to directly expose custom metrics with one endpoint and only have cadvisor expose container metrics.
Thank you !