Skip to content

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

Open
QuentinBisson wants to merge 2 commits into
kagent-dev:mainfrom
QuentinBisson:feat/chart-podmonitors
Open

QuentinBisson wants to merge 2 commits 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 charts ship 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. The substrate-atelet chart renders atelet's monitor, and the substrate chart renders the atelet and credential provider monitors only when it renders those workloads. 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 runs the unit tests of all three charts.

The default render does not change (hack/render-manifests.sh --check passes).

AI use: AI-assisted, including the commit messages and this description. I reviewed the change and the tests.

@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
@EItanya
EItanya force-pushed the main branch 3 times, most recently from 74f71ca to bf51a99 Compare September 26, 2026 21:43
@EItanya
EItanya force-pushed the main branch 4 times, most recently from 156e3da to 4d0e339 Compare October 1, 2026 15:52
@QuentinBisson
QuentinBisson force-pushed the feat/chart-podmonitors branch from 1d89c48 to bdecb82 Compare October 2, 2026 08:51
@EItanya
EItanya force-pushed the main branch 2 times, most recently from ee87afb to c2e2e13 Compare October 4, 2026 16:46
@QuentinBisson
QuentinBisson force-pushed the feat/chart-podmonitors branch from bdecb82 to 86e6868 Compare October 5, 2026 09:02
@EItanya
EItanya force-pushed the main branch 2 times, most recently from 16274c0 to 9f9b552 Compare October 6, 2026 22:08
@QuentinBisson
QuentinBisson force-pushed the feat/chart-podmonitors branch 2 times, most recently from 03fcf97 to 96b3f5e Compare October 13, 2026 13:29
@QuentinBisson
QuentinBisson force-pushed the feat/chart-podmonitors branch from 96b3f5e to 13a7a00 Compare October 26, 2026 13:15
@EItanya
EItanya force-pushed the main branch 2 times, most recently from 446feee to 783f8bf Compare October 29, 2026 04:06
@QuentinBisson
QuentinBisson force-pushed the feat/chart-podmonitors branch from 13a7a00 to 3fd6dd2 Compare October 29, 2026 11:27
@QuentinBisson
QuentinBisson force-pushed the feat/chart-podmonitors branch 2 times, most recently from 1bfd697 to 4d19c68 Compare November 7, 2026 01:50
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>
Signed-off-by: QuentinBisson <quentin@giantswarm.io>
With atelet.enabled=false, atelet runs from the substrate-atelet chart,
and the substrate chart still rendered a monitor for it. Both charts
name that monitor after the substrate release, so the two releases would
fight over one object.

The substrate chart now renders the atelet and credential provider
monitors only when it renders those workloads. The substrate-atelet
chart takes the same metrics.podMonitor values and renders atelet's.
helm-verify runs the unit tests of all three charts. The PodMonitor
files take the repo's copyright header.

Signed-off-by: QuentinBisson <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