Repository navigation
Description
Problem
Four settings in k8s/monitoring/k8s-monitoring-values.yaml (k8s-monitoring 4.5.2) don't do what the file, or the change that set them, says they do. All four are chart features that already exist. The repo either sets them the wrong way or leaves them unset. Checked live and against the chart source on 2026-10-03.
1. node-exporter's allow list was narrowed, not widened (a regression from #922/#923). 0778f60 (#923) changed hostMetrics.linuxHosts.metricsTuning.useIntegrationAllowList from true to false "to preserve host disk and network metrics". The chart works the other way round. charts/feature-host-metrics/templates/_linux_hosts.alloy.tpl concatenates three lists:
default-allow-lists/node-exporter.yamlwhenuseDefaultAllowListis set (on by default; 12 entries:node_cpu.*,node_filesystem.*,node_memory.*, four network byte and drop counters, build info andprocess_*);default-allow-lists/node-exporter-integration.yaml(157 entries), only whenuseIntegrationAllowLististrue;includeMetrics.
So false removes the 157-entry list. The node-exporter pods still expose node_load1, node_disk_io_now and the rest (read through the pod proxy), so the allow list is what drops them. In Prometheus, the last sample of node_load1, node_uname_info, node_context_switches_total and node_disk_read_bytes_total is at 2026-10-02 04:14:53Z to 04:15:38Z on every node. The k8s-monitoring-alloy-* releases moved to revision 2 at 04:15:46Z.
k8s/monitoring/dashboards/k8s-views-nodes.jsonqueries 22node_*series that Prometheus no longer has: context switches, disk I/O now, disk read/written bytes, disk reads/writes completed, file descriptors allocated/maximum, interrupts, load 1/5/15,node_netstat_Tcp_CurrEstab, network receive/transmit errors and packets, conntrack entries and limit, timex estimated error and max error, andnode_uname_info.- 20 of the 22 are in the integration list.
node_disk_io_nowandnode_netstat_Tcp_CurrEstabare in no chart list. - "Node Exporter Full" (gnetId 1860, provisioned from
grafana-values.yaml) builds both its$joband$nodevariables fromlabel_values(node_uname_info, ...), so the whole dashboard shows no data. - None of the fix(monitoring): alerts reach an Alertmanager, and homelab rules cover nodes, GPUs, storage and the stack without k3s false positives (#549) #1094 alert rules in
prometheus-values.yamluses a missing series.
2. alloy-singleton runs as a 4-pod DaemonSet. collectors.alloy-singleton sets only alloy.enableReporting and resources, with no presets. The block has had none since it was introduced; UPGRADING.md shows alloy-singleton: {} as its v4 example. The chart's collectors/presets/singleton.yaml (controller.type: deployment, replicas: 1) is what makes a collector a singleton. Without it, the Alloy chart's default applies, which is a DaemonSet.
- Live:
daemonset.apps/k8s-monitoring-alloy-singletonis 4/4, one pod per node. The Alloy CRk8s-monitoring-alloy-singletonhas nospec.controller.type, whilealloy-metricsis a statefulset with 1 replica andalloy-logsis a daemonset. clusterEvents(collectoralloy-singleton,clusteringunset) runsloki.source.kubernetes_events "cluster_events"in every pod.charts/feature-cluster-events/values.yamlsays that without clustering the feature "should run on a singleton collector".- Per-pod
loki_write_sent_entries_total, read on :12345: 1640, 1731, 1668 and 74 (the last pod had restarted 84 minutes earlier). Each pod ships the whole event stream. - Over 6h, Loki processed 452 eventhandler lines and returned 349. It drops entries with an identical stream, timestamp and line, which hides the duplicates. The cost is 4 API-server event watches, 4 pushes of every event, and 4 x (50m CPU, 128Mi) in requests.
- The
alloy-events-ingressIngress (k8s/ingress/ingress-routes.yaml) load-balances across 4 different Alloy UIs.
3. Every Alloy-written series carries the cluster name twice. The chart's prometheus destination defaults to clusterLabels: [cluster, k8s.cluster.name] (destinations/prometheus-values.yaml:66). The rendered prometheus.remote_write "localprometheus" therefore adds both cluster and k8s_cluster_name. Every dashboard and rule keys on cluster only. Under k8s/ and src/, git grep k8s_cluster_name finds the label only in two capture fixtures (tests/fixtures/metrics/dcgm-exporter.yaml, litellm.yaml).
4. One kube-state-metrics allow-list entry can never match. clusterMetrics.kube-state-metrics.metricsTuning.includeMetrics lists kube_hpa_labels (line 55), a kube-state-metrics v1 name. The deployed KSM is v2.20.0, which serves only kube_horizontalpodautoscaler_*. The chart's default KSM allow list already carries kube_horizontalpodautoscaler_*. The dashboards that query the old name are fixed in #1136.
Two tests pin the regression: tests/test_k8s_monitoring_integration.py:78-82 and :135-141 assert useIntegrationAllowList is False, and :70 requires kube_hpa_labels.
Update 2026-10-08: item 1 is re-scoped from "widen the allow list" to "no allow list on node-exporter". #1175 (v0.2.26) set useIntegrationAllowList: true and added node_disk_io_now, node_netstat_Tcp_CurrEstab, node_uname_info and node_load.* to includeMetrics. Node Exporter Full's variables work again, but the dashboard still shows gaps:
- It queries 208 metric names. The live keep regex of the
integrations/node_exporterjob matches 159. - 38 of the other 49 are served by node-exporter (read through the pod proxy on one node) and dropped by the keep rule:
node_procs_blocked,node_forks_total,node_schedstat_*,node_entropy_available_bits,node_scrape_collector_{duration_seconds,success},node_systemd_units,node_disk_{reads,writes}_merged_total,node_disk_discard*,node_hwmon_temp_{crit,crit_alarm,max}_celsius,node_cooling_device_*,node_power_supply_online,node_timex_{loop_time_constant,frequency_adjustment_ratio,tick_seconds,tai_offset_seconds},node_netstat_Tcp_{ActiveOpens,PassiveOpens},node_netstat_Ip_Forwarding,node_netstat_TcpExt_{TCPRcvQDrop,TCPOFOQueue,Syncookies*},node_network_{receive_frame,transmit_carrier,transmit_colls}_total,node_sockstat_FRAG_memory,process_virtual_memory{,_max}_bytes. - The remaining 11 are not served:
node_processes_*(processes collector, off by default),node_interrupts_total(interrupts, off),node_tcp_connection_states(tcpstat, off),node_systemd_socket_accepted_connections_total(the systemd collector reports only the host service units), and names this kernel, hardware or node-exporter version does not serve (node_netstat_Tcp_MaxConn,node_hwmon_temp_crit_hyst_celsius,process_resident_memory_max_bytes). - The flag has flipped in three releases (v0.2.24
true, v0.2.25false, v0.2.26true), each time adding a few names. An allow list cannot track a third-party dashboard, and node-exporter's collector flags already decide what is collected. - In the chart template,
useDefaultAllowList: false,useIntegrationAllowList: falseand an emptyincludeMetricsrender nokeeprule (_linux_hosts.alloy.tpl: the keep block is guarded byif $metricAllowList). The filesystem-type drop rule stays. - Cost, measured 2026-10-08: node-exporter serves 8,057 series across the four nodes and the keep rule passes 4,528, so about 3.5k more head series. Prometheus head: 78.6k. fix(k8s): the prometheus server scrapes only itself and the otel collector, and k8s-monitoring discovers every other target #1130 removes about 50k.
Acceptance criteria
-
hostMetrics.linuxHosts.metricsTuningsetsuseDefaultAllowList: falseanduseIntegrationAllowList: falseand has noincludeMetrics, so theintegrations/node_exporterjob keeps every series node-exporter serves. The comment says that node-exporter's collector flags (telemetryServices.node-exporter.extraArgs) decide what is collected, and why there is no allow list (see the 2026-10-08 update). The feat(monitoring): homelab hosts send their journals to Loki and their health metrics to Prometheus #1080 names stay covered, because node-exporter serves them all. -
collectors.alloy-singleton.presets: [singleton]. -
destinations.localPrometheus.clusterLabels: [cluster]. -
kube_hpa_labelsis removed from the KSMincludeMetrics. - A test rebuilds the effective keep list the way
_linux_hosts.alloy.tpldoes (default list ifuseDefaultAllowList, which defaults to true; then the integration list ifuseIntegrationAllowList; thenincludeMetrics) and asserts that it is empty. It does not need the chart's list contents, so no list fixture is checked in.- Verified by the test passing, and by a one-time mutation in review: removing
useDefaultAllowList: false(the chart default istrue) must make it fail.
- Verified by the test passing, and by a one-time mutation in review: removing
- A test asserts, as one structural tuple:
- every collector under
collectorsnames exactly one controller preset out ofsingleton,daemonset,statefulsetanddeployment; - the collector assigned to
clusterEventsusessingletonwhileclusterEvents.clusteringis unset or false. - Verified by a mutation in review: removing
presetsfromalloy-singletonmust make it fail.
- every collector under
-
tests/test_k8s_monitoring_integration.pyexpectsTrueat both places that pin the allow-list flag, and no longer requireskube_hpa_labels. Any fixture or test that compares Alloy series labels dropsk8s_cluster_name. - No test reaches the network or runs
helm. Each new test's call phase stays under 1 s (uv run pytest tests/test_k8s_monitoring_integration.py --durations=10), anduv run devops cipasses within its 5-minute budget. -
changelog.d/<n>.mdexists. CHANGELOG.md and docs/ROADMAP.md are untouched (uv run devops pr check-readinesspasses). - Pending a person, after merge (applied by
uv run devops k8s deploy-stack --stack infra, or by feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755's Application once it exists):Expected:kubectl get deploy,ds -n monitoring | grep alloy-singletondeployment.apps/k8s-monitoring-alloy-singleton 1/1and no DaemonSet of that name. Then, in Grafana Explore against Prometheus, 10 minutes later:count(node_uname_info)equals the node count;count({__name__=~"node_load1|node_context_switches_total|node_netstat_Tcp_CurrEstab|node_disk_io_now"}) by (__name__)returns all four names;count(count_over_time({k8s_cluster_name!=""}[5m]))is empty;- Node Exporter Full shows data for every node, in every panel except the processes, interrupts and TCP connection-state panels (collectors off by default) and panels for hardware a node lacks;
count by (__name__) ({__name__=~"node_procs_blocked|node_forks_total|node_scrape_collector_success|node_systemd_units", job="integrations/node_exporter"})returns all four names.
Key questions
- Why no allow list instead of a wider one? Decided 2026-10-08 (re-scope): the integration list still drops 38 of the names Node Exporter Full reads, and each release that widened or narrowed the list left a different set of panels empty. The chart renders no
keeprule when all three sources are empty, and node-exporter's collector flags remain the one place that decides what is collected. - What does no allow list cost? Proposed: accept it. About 3.5k more head series across four nodes (8,057 served against 4,528 kept on 2026-10-08), against a 78.6k head. fix(k8s): the prometheus server scrapes only itself and the otel collector, and k8s-monitoring discovers every other target #1130 removes about 50k head series from the unused API-server job, which is far more than this adds.
- Should the processes, interrupts or tcpstat collectors be turned on for the remaining empty panels? Proposed: no, not in this item. interrupts is per IRQ per CPU, and node-exporter's own docs warn that tcpstat has performance issues under load. processes is cheap, so it can be a follow-up if its panels are wanted.
- Should the gate render the chart with
helm template? Proposed: no. The gate never reaches the network and has a 5-minute budget, and the chart isn't vendored. The fixture copies the two lists from the pinned chart version. When feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 pinsversionper release, a test asserts that the fixture header's version equals the k8s-monitoring pin, so a chart bump forces a fixture refresh. - Does switching the singleton from a DaemonSet to a Deployment lose or duplicate events? Proposed: no loss that matters. The new pod starts a fresh watch. Events re-sent with an identical timestamp and line are dropped by Loki, as they are today, and nothing alerts on event volume.
node_disk_io_nowandnode_netstat_Tcp_CurrEstab, which no chart list has? With no allow list they need no entry. fix(k8s): the kubernetes, node and ingress dashboards query only series something serves, checked against captured exporter families and the chart allow lists #1136 fixes therate()applied to thenode_disk_io_nowgauge.- Does dropping
k8s_cluster_namebreak anything? Proposed: no. No dashboard, rule or CLI query reads it, and existing series age out under the 30-day retention.
Strategic alignment
- P1 bug. Since 2026-10-02 04:15Z, Node Exporter Full shows no data and 22 node series behind the node dashboard are missing. This is a regression from fix(k8s): restore k8s-monitoring metrics, add sre service dashboard and otel loki exporter (#922) #923. The singleton fix removes three redundant event watchers.
- Value: high (node dashboards and host diagnosis work again). Effort: S (one values file, two tests).
- Library-first: chart presets and allow-list flags only; nothing hand-rolled.
- Related: fix(k8s): grafana k8s-monitoring missing metrics, sre service dashboard and otel loki exporter #922/fix(k8s): restore k8s-monitoring metrics, add sre service dashboard and otel loki exporter (#922) #923 (origin of the regression), feat(monitoring): homelab hosts send their journals to Loki and their health metrics to Prometheus #1080 (its
includeMetricsstay), fix(k8s): restore kubernetes cpu metrics and align monitoring dashboards to homelab-k3s #737, feat(k8s): argo cd keeps the homelab cluster at the current release branch, with automated sync, prune and self-heal that never delete data #755 (chart pin the fixture follows), fix(k8s): the prometheus server scrapes only itself and the otel collector, and k8s-monitoring discovers every other target #1130 (cluster label on the server side), fix(k8s): the kubernetes, node and ingress dashboards query only series something serves, checked against captured exporter families and the chart allow lists #1136 (dashboard queries).
Update 2026-10-08: refinement
The test criterion contradicts the re-scope. It becomes: the cAdvisor test (tests/test_k8s_monitoring_integration.py:29-84) no longer reads useIntegrationAllowList or requires kube_hpa_labels, and the host-metrics test (:129) asserts both flags False with no includeMetrics. No list fixture is checked in; #1131 and #1136 add theirs.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 9, 2026
Moved to v0.2.32: v0.2.32 started with fewer than its 12 items and was topped up to 12 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)
fix(k8s): k8s-monitoring collectors run in the chart's preset shapes,…
dan-petty-bot commentedon Oct 9, 2026
What changed
#1500, merged into
release/v0.2.32as 48410de.11 file(s) changed.
How it was verified
Check runs at 8ef1cc1:
Acceptance Criteria of
docs/agent/tasks/task-1129-k8s-monitoring-presets-and-node-exporter-series.md:hostMetrics.linuxHosts.metricsTuningsetsuseDefaultAllowList: falseanduseIntegrationAllowList: falseand has noincludeMetrics, with a comment saying that node-exporter's collector flags (telemetryServices.node-exporter.extraArgs) decide what is collected and why there is no allow list.test_host_metrics_keep_the_series_that_explain_a_host_failurerebuilds the keep sources the way_linux_hosts.alloy.tplconcatenates them (default list unlessuseDefaultAllowListis false, integration list whenuseIntegrationAllowListis true, thenincludeMetrics), without the lists' contents, and asserts they are empty alongside the unchanged node-exporter arguments and D-Bus address. No list fixture is checked in.useDefaultAllowList: false(the chart default istrue) failstest_host_metrics_keep_the_series_that_explain_a_host_failurewith keep sources['default'].collectors.alloy-singleton.presets: [singleton].test_each_alloy_collector_runs_in_one_controller_presetasserts, as one tuple, that each collector names exactly one of the controller presetssingleton,daemonset,statefulsetanddeployment, and that theclusterEventscollector usessingletonwhileclusterEvents.clusteringis unset or false.presetsfromalloy-singletonfailstest_each_alloy_collector_runs_in_one_controller_preset.destinations.localPrometheus.clusterLabels: [cluster], pinned bytest_alloy_writes_the_cluster_name_once; deleting the line fails it.kube_hpa_labelsis removed from the KSMincludeMetrics. The refinement of 2026-10-08 replaced the criterion that expectedTrueat both places pinning the allow-list flag:test_k8s_monitoring_cadvisor_and_ksm_metrics_tuningno longer readsuseIntegrationAllowListor requireskube_hpa_labels, and the host-metrics test asserts both flags off with noincludeMetrics.tests/fixtures/metrics/litellm.yaml,dcgm-exporter.yaml) dropk8s_cluster_namefrom their Alloy target labels;tests/test_stack_dashboards.pypasses against them.helm. Each new or changed test's call phase is 0.01 s (uv run pytest tests/test_k8s_monitoring_integration.py --durations=10).changelog.d/1129.mdexists;CHANGELOG.mdanddocs/ROADMAP.mdare untouched.helm templateof the k8s-monitoring 4.5.2 chart with the previous and the new values differs in exactly four hunks:kube_hpa_labelsleaves the KSM keep regex; thenode_exporterkeep rule is gone (the ramfs/tmpfs drop rule stays);k8s_cluster_nameleaves theprometheus.remote_write "localprometheus"external labels; thealloy-singletonAlloy resource gainstype: deploymentandreplicas: 1.k8s-monitoringApplication (it tracks main with selfHeal, so do not apply early withdevops k8s deploy-stackfrom the release branch: Argo CD would revert it):kubectl get application -n argocd k8s-monitoring -o jsonpath='{.status.sync.status} {.status.sync.revisions}'printsSynced ["4.5.2","<new main sha>"].kubectl get alloys.collectors.grafana.com -n monitoring k8s-monitoring-alloy-singleton -o jsonpath='{.spec.controller.type} {.spec.controller.replicas}'printsdeployment 1.kubectl get deploy,ds -n monitoring | grep alloy-singletonshows onlydeployment.apps/k8s-monitoring-alloy-singleton 1/1, and no DaemonSet of that name.kubectl get endpointslices -n monitoring -l kubernetes.io/service-name=k8s-monitoring-alloy-singleton -o jsonpath='{range .items[*].endpoints[*]}{.addresses[0]}{"\n"}{end}' | wc -lprints1, so the events Ingress reaches one Alloy UI.count(node_uname_info)equals the node count;count by (__name__) ({__name__=~"node_load1|node_context_switches_total|node_netstat_Tcp_CurrEstab|node_disk_io_now"})returns all four names;count by (__name__) ({__name__=~"node_procs_blocked|node_forks_total|node_scrape_collector_success|node_systemd_units", job="integrations/node_exporter"})returns all four names;count({k8s_cluster_name!=""})is empty (the issue'scount_over_timeform errors on duplicate labelsets).feat(release): v0.2.32 (#1516)