We are already using node-exporters to pull/collect docker/container metrics within our kubernetes environment. Next we would also like to be able to collect application metrics (provided by spring-actuator in our case, eg. http://pod-name:8080/prometheus). How is this typically done, keeping in mind we cannot use Kubernetes services as fixed DNS names (they are load balanced over the pods behind the service) and the fact that pods disappear and appear all the time, changing their name and hence addressability?
Our initial naive approach was the following (but this will not be sufficient since it is load-balanced by the service):
- job_name: 'example-service'
scheme: http
metrics_path: '/prometheus'
static_configs:
- targets: ['example-service:8080']
Any advice or examples would be really great.
Thanks a lot in advance,
Bart