Closed JohanLindvall closed 7 months ago
Which operator still uses those annotations?
From kube-prometheus-stack:
The prometheus operator does not support annotation-based discovery of services, using the PodMonitor or ServiceMonitor CRD in its place
Sorry for the very slow reply. We are not using the Prometheus operator. We are using a plain old Prometheus deployment, configured according to https://github.com/prometheus/prometheus/blob/main/documentation/examples/prometheus-kubernetes.yml#L267
@caleblloyd
I recommend adding the labels you need for your Prometheus deployment via:
podTemplate:
merge:
metadata:
labels:
your-label: here
I ran into this today. Needed to add this to my values.yaml
.
promExporter:
enabled: true
podTemplate:
merge:
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: "/metrics"
prometheus.io/port: "7777"
Without the annotations, Prometheus doesn't automatically scrape the NATS pods. Would be better if the NATS Helm chart applied the annotations if promExporter
is enabled.
I faced the same issue. At least the documentation should state that in addition to
promExporter:
enabled: true
The K8s annotations should be set as well.
What version were you using?
Helm chart 1.1.5, Values.yaml:
Prometheus doesn't discovery the promExporter container, because the pod doesn't have the appropriate labels. See https://github.com/nats-io/k8s/pull/77/files where it was added (but never copied over)
What environment was the server running in?
Kubernetes, see above
Is this defect reproducible?
Yes
Given the capability you are leveraging, describe your expectation?
I expect the metrics endpoint to be automatically discovered by Prometheus
Given the expectation, what is the defect you are observing?
The metrics endpoint isn't discovered.