-
I am using a Karavan k8s spring boot. I am wondering did anyone tried to set up and expose Prometheus metrics so they can be collected. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Yeah you need to do all of this the standard spring boot way - add some prometheus -starter as dependency and maybe some configuration into application.properties. And add camel-micrometer-starter then it auto collects metrics and via a micrometer-promethus (spring boot standard) then it can be exposed over http in prometheus protcol In karavan, you can just add camel-micrometer as dependency |
Beta Was this translation helpful? Give feedback.
-
@davsclaus thank you for your reply. I was able to enable prometheus metrics actuator endpoint. I have next question, when my pod is running with metrics exposed I need to dynamically tell prometheus to scrape it and I would like to do that using Prometheus operator. I would like to add custom label that wil be there for all deployed pods and then I will use that label to tell PrometheusOperator to scrape. CUrrent pod has these labels:
|
Beta Was this translation helpful? Give feedback.
Yeah you need to do all of this the standard spring boot way - add some prometheus -starter as dependency and maybe some configuration into application.properties.
And add camel-micrometer-starter then it auto collects metrics and via a micrometer-promethus (spring boot standard) then it can be exposed over http in prometheus protcol
https://camel.apache.org/components/3.20.x/micrometer-component.html#_spring_boot_auto_configuration
In karavan, you can just add camel-micrometer as dependency