Kubernetes Custom metrics not available at Service level

10/6/2020

I have installed Prometheus server and adapter on Kubernetes cluster, to collect metrics from Kubernetes objects.

Prometheus server and adapter are installed using Helm charts and they are running fine. Now deployed Spring boot app which serves metrics at the endpoint /actuator/prometheus.

added below annotation in deployment file:

annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "8080"
        prometheus.io/path: "/actuator/prometheus"    

Now i could see custom metrics at pod level: enter image description here

When i try to see metrics at Service level, it is throwing error:

Error from server (NotFound): the server could not find the metric redis_queue_box_provider_size for service

metric samples collected into prometheus server: enter image description here

Is there any configuration i have to do to gather metrics at service level?

-- Rajeev
amazon-eks
aws-fargate
hpa
kubernetes
prometheus

0 Answers