snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Enhancement : add Prometheus annotation when extension : metrics + kubernetes are used #126

Closed snowdrop-bot closed 4 years ago

snowdrop-bot commented 4 years ago

when we are using metrics + kubernetes extensions, should we add those annotations to the pods into the generated file target\kubernetes\kubernetes.yml

I found this in prometheus helm chart documentation : https://github.com/helm/charts/tree/master/stable/prometheus

In order to get prometheus to scrape pods, you must add annotations to the the pods as below:

metadata:
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/path: /metrics
    prometheus.io/port: "8080"
spec:

I tested by adding

kubectl annotate pods iep-monitoring-junk-f8fbbdbb9-84jkt prometheus.io/scrape="true" kubectl annotate pods iep-monitoring-junk-f8fbbdbb9-84jkt prometheus.io/path=/metrics kubectl annotate pods iep-monitoring-junk-f8fbbdbb9-84jkt prometheus.io/port="8080"

and Prometheus started to scrape metrics from my application.


https://github.com/quarkusio/quarkus/issues/10301


$upstream:10301$