Skip to content

feat(helm): add PodMonitors for the workloads that serve metrics - #46

Open
QuentinBisson wants to merge 1 commit into
kagent-dev:mainfrom
QuentinBisson:feat/chart-podmonitors
Open

QuentinBisson wants to merge 1 commit into
kagent-dev:mainfrom
QuentinBisson:feat/chart-podmonitors

Conversation

@QuentinBisson

@QuentinBisson QuentinBisson commented Sep 21, 2026 •

Copy link
Copy Markdown

Six workloads serve Prometheus metrics, but the chart ships no monitor object. A Prometheus Operator installation ignores the prometheus.io/* annotations, so none of these metrics are collected.

This adds one PodMonitor per workload that serves metrics, behind metrics.podMonitor.enabled (off by default, because the object needs the Prometheus Operator CRDs), with interval and labels. podcertificate-controller gets none: it emits no metrics. The unit tests pin each workload's port name and pod label, because a wrong value matches nothing and reports no error. helm-verify gains a helm-unittest step to run them.

The default render does not change (make verify-helm-template passes).

@QuentinBisson

Copy link
Copy Markdown
Author

@EItanya I had to force push

@EItanya
EItanya force-pushed the main branch 2 times, most recently from 0401cc1 to 08c930d Compare September 23, 2026 18:41
Six workloads serve a Prometheus endpoint on a pod port and nothing
collects any of them. ate-api-server, atelet, the atenet router, the
atenet egress and the k8s credential provider start the metrics server
in serverboot; ate-controller serves controller-runtime's own on :8080,
its default, since its ctrl.Options sets no Metrics field. The router
and the egress each add a second port for their agentgateway container.

Three of those pods carry prometheus.io/* annotations, which a Prometheus
reads only when it is configured for pod-annotation discovery. A
Prometheus Operator installation discovers PodMonitors instead and
ignores the annotations, so on such an installation every one of these
endpoints is served and none is collected.

Add one PodMonitor per workload, off by default because the object needs
the monitoring.coreos.com/v1 CRDs. The port name and the pod label are
pinned per workload: no two metrics sources agree on the port name, and
the credential provider's label is the substrate.fullname helper's output
rather than the bare component name. A wrong name or label yields a
monitor that matches nothing and reports no error.

podcertificate-controller gets no monitor. It emits no metrics, which
docs/metrics/substrate.yaml records under blind_spots.

Run the new chart unit tests in helm-verify, which had no way to run them.

Signed-off-by: Quentin Bisson <quentin@giantswarm.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant