JDev
JDev

Reputation: 2531

Kubernetes: Prometheus annotations and endpoint name

can someone answer me the following questions, otherwise it's a little unclear to me.

  1. How do I understand and where to look what annotations exist at all? Is there a list somewhere or template?

  2. Standard annotations work and prometheus sees this service. Everything is ok with this.

    annotations: prometheus.io/scrape: 'true' prometheus.io/path: '/actuator/prometheus' prometheus.io/port: '8700'

  3. But the service is displayed as Endpoint IP. Is there any possibility, setting, so that not Endpoint IP is displayed in prometheus targets, but the service name and namespace?

Thanks

Upvotes: 0

Views: 5326

Answers (1)

Marc ABOUCHACRA
Marc ABOUCHACRA

Reputation: 3463

I'll try and give you some answer based on what I understand from your question.

  1. About the annotations : to know wich are the one used by the Helm chart, well there is no magic here, you need to read the templates files. Although, most of those annotations are listed in the values.yaml file under the relabel_configs section. You'll find blocks like this one
        relabel_configs:
          - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
            action: keep
            regex: true

This means that all the ressource of this job that has the prometheus.io/scrape annotation with the value true will be scrapped.

  1. Yes, this is normal based on the content of the values.yaml file.

  2. On the target page, Prometheus will always print the IP address under the Endpoint column. However you can play with the configuration in order to print the namespace and ressource name under the Labels column if it's not already here.

Upvotes: 1

Related Questions