Repository navigation
Closed
Labels
Description
Friction
Every log stream k8s-monitoring writes to Loki carries both cluster and k8s_cluster_name with the same value, while Prometheus series carry only cluster. The two stores label the cluster differently, so a selector built from Loki's label browser on k8s_cluster_name matches nothing in Prometheus. #1129 fixed the Prometheus destination and its PR (#1500) named the Loki destination as an owner follow-up that was never filed.
Evidence
Live, read-only, 2026-10-18:
- Loki label names include both
clusterandk8s_cluster_name;k8s_cluster_namehas one value, equal tocluster.{cluster=~".+", k8s_cluster_name=""}and the reverse each return 0 streams over 24h (85 streams in 24h carry both). It adds no streams or cardinality. - Prometheus label names have
clusterand nok8s_cluster_name. - ConfigMaps
monitoring/k8s-monitoring-alloy-logsand-alloy-singletonrenderloki.write "localloki"withexternal_labels = {"cluster" = ..., "k8s_cluster_name" = ...};-alloy-metricsrendersprometheus.remote_write "localprometheus"with only"cluster".
Repo:
k8s/monitoring/k8s-monitoring-values.yaml:13-15setsclusterLabels: [cluster]onlocalPrometheusonly, with a comment that the chart default would also writek8s_cluster_name;localLoki(:16-18) inherits the k8s-monitoring 4.5.2 default[cluster, k8s.cluster.name](chartdestinations/loki-values.yaml:74, written as external labels by_destination_loki.tpl:165-169).tests/test_k8s_monitoring_integration.py:271-276(test_alloy_writes_the_cluster_name_once) pins only the Prometheus destination.docs/agent/tasks/task-1129-k8s-monitoring-presets-and-node-exporter-series.md:17scopes fix(k8s): k8s-monitoring collectors run in the chart's preset shapes, and node-exporter keeps the series the node dashboards read #1129 to the Prometheus destination. Nothing ink8s/,src/ortests/readsk8s_cluster_name.- An offline
helm templateof chart 4.5.2 withdestinations.localLoki.clusterLabels: [cluster]differs from today's render in exactly two lines: thek8s_cluster_nameexternal label leavesloki.write "localloki"in alloy-logs and alloy-singleton.
Remedy
- Test first: extend
test_alloy_writes_the_cluster_name_onceto assert, as one tuple, thatlocalPrometheusandlocalLokiboth haveclusterLabels == ["cluster"]. k8s/monitoring/k8s-monitoring-values.yaml:16-18: addclusterLabels: [cluster]tolocalLoki, and generalise the comment at:13to both destinations.- Add a "since #" note to
task-1129-...md:17, andchangelog.d/<issue>.mdunder### Fixed; cite fix(k8s): k8s-monitoring collectors run in the chart's preset shapes, and node-exporter keeps the series the node dashboards read #1500's unfiled follow-up as the origin. - Argo CD applies it after the release merges into main; each stream's label set changes once, and queries keyed on
clusterare unaffected. Check afterwards that{k8s_cluster_name=~".+"}returns no new streams.
Priority: P3. Severity low: a consistency fix with a one-line change.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 18, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate fixes an inconsistency in how cluster labels are written to Loki versus Prometheus, which is a behavioral bug.It's a consistency fix with minimal impact and low severity.The change improves consistency but does not affect core functionality or user experience significantly.The fix involves only adding one line to configuration and updating tests, with no major code changes.fix(monitoring): the Grafana rate panels hold two samples, the dashbo…
dan-petty commentedon Oct 23, 2026
Delivered by #1958: the k8s-monitoring Loki and Pyroscope destinations set
clusterLabels: [cluster], so logs and profiles carryclusteronce, as the metrics do.refactor(roadmap): intake files every new candidate, with no agent fi…