Repository navigation
Description
Problem
Nothing scrapes the Alloy collectors, Grafana or Pyroscope, so the components that move every metric and log line can fail silently. Checked live on 2026-10-03.
- Prometheus has no
alloy_*,loki_write_*,grafana_*orpyroscope_*series. The onlyprometheus_remote_storage_*series come from the server's self-scrape and from Loki's ruler. - The endpoints are up but unscraped. Grafana's
:3000/metricsserves 2,716grafana_*lines, andpyroscope-0:4040/metricsserves 3,177pyroscope_*lines. alloy-metrics-0's own/metrics, read through the pod proxy, reportsprometheus_remote_storage_samples_failed_total= 73,595 and..._retried_total= 14,612, out of 9.48M samples. Its log has 22non-recoverable error ... HTTP 400: out of order samplelines in 24h. Those samples are lost, and nothing alerts (the cause is fix(telemetry): devops-cli metrics reach prometheus in one hop, a late sample no longer drops a whole batch, and the collector runs only what its pipelines use #1132).alloy-logsreportsloki_write_dropped_entries_total= 0. That is healthy, but Prometheus can't see it, so feat(k8s): alert when pod logs stop reaching loki #890's log-silence alert has nothing to build on.
k8s-monitoring 4.5.2 ships integrations.alloy and integrations.grafana. Their default allow lists already contain the series needed: integrations/alloy.yaml has prometheus_remote_storage_samples_failed_total, loki_write_dropped_entries_total and loki_write_sent_entries_total. The chart has no Pyroscope integration. Its prometheusOperatorObjects feature is on, though, so the pyroscope chart's own serviceMonitor.enabled (currently false, k8s/monitoring/pyroscope-values.yaml:46-47) would be picked up.
Selector detail: the k8s-monitoring collector pods are labelled app.kubernetes.io/name = alloy-metrics, alloy-logs and alloy-singleton, and all expose port http-metrics, the integration's default port name. app.kubernetes.io/name: alloy matches only pyroscope-alloy-0, which #1134 removes. The Grafana integration defaults (name=grafana, port grafana) match the live pod. alloy-operator is not an Alloy instance, so there are 4 Alloy instances to scrape (3 after #1134), not 5.
Acceptance criteria
-
k8s/monitoring/k8s-monitoring-values.yamlintegrations(the block fix(k8s): the prometheus server scrapes only itself and the otel collector, and k8s-monitoring discovers every other target #1130 creates) gains two instances, with the default allow lists:alloy, namedk8s-monitoring, withlabelSelectors: {app.kubernetes.io/name: [alloy-metrics, alloy-logs, alloy-singleton]};grafana, namedgrafana.
-
k8s/monitoring/pyroscope-values.yamlsetsserviceMonitor.enabled: true. -
k8s/monitoring/prometheus-values.yamlgains ahomelab-telemetry-pipelinerule group with two rules. Each carriesseverityand asummary/descriptionlike the existing rules:AlloyRemoteWriteSamplesFailed(warning):increase(prometheus_remote_storage_samples_failed_total{job="integrations/alloy"}[15m]) > 0for 15m;AlloyLogEntriesDropped(warning):increase(loki_write_dropped_entries_total{job="integrations/alloy"}[15m]) > 0for 15m.
- tests/test_k8s_monitoring_alerting.py asserts, as one structural tuple:
- the two rules' names, expressions and severities;
- the Alloy integration's selector set;
- the Grafana instance;
- that Pyroscope's ServiceMonitor is enabled.
- A test asserts that every metric name the new rules use is in the chart's integration allow list. It reads a checked-in copy of
integrations/alloy.yaml's list (the fix(k8s): k8s-monitoring collectors run in the chart's preset shapes, and node-exporter keeps the series the node dashboards read #1129 fixture pattern, chart version in the header). - No test reaches the network. Each new test's call phase is under 1 s. A
changelog.d/<n>.mdfragment exists; CHANGELOG.md and docs/ROADMAP.md are untouched. - Pending a person, after the infra stack is redeployed:
count by (job) (up{job=~"integrations/alloy|integrations/grafana|.*pyroscope.*"})shows 3 Alloy targets (4 before feat(k8s): profiles come from k8s-monitoring's profiling feature for every workload, and the profiling dashboards list what is profiled #1134), 1 Grafana and 1 Pyroscope;sum by (pod) (loki_write_sent_entries_total)returns one row peralloy-logspod andalloy-singleton;AlloyRemoteWriteSamplesFailedstays inactive for 24h once fix(telemetry): devops-cli metrics reach prometheus in one hop, a late sample no longer drops a whole batch, and the collector runs only what its pipelines use #1132 has landed. Before fix(telemetry): devops-cli metrics reach prometheus in one hop, a late sample no longer drops a whole batch, and the collector runs only what its pipelines use #1132, it fires, which demonstrates the rule.
Key questions
- Should this extend Metrics for the rest of the platform #551 instead of being a new item? Proposed: a new item. Metrics for the rest of the platform #551 is scoped to platform components (ArgoCD, Valkey, registry, Qdrant), each needing an exporter or ServiceMonitor. This item only turns on chart integrations for the monitoring stack itself and is one PR. Metrics for the rest of the platform #551 is amended to drop Loki, cloudflared and the collector, and to point here for Alloy, Grafana and Pyroscope.
- Should the log-pipeline-silence alert land here? Proposed: no, it stays in feat(k8s): alert when pod logs stop reaching loki #890, which is amended to depend on this item rather than Metrics for the rest of the platform #551. This item supplies
loki_write_sent_entries_totaland the drop alert. feat(k8s): alert when pod logs stop reaching loki #890 decides the silence threshold per namespace. - Would
AlloyRemoteWriteSamplesFailedpage from day one? Proposed: yes, until fix(telemetry): devops-cli metrics reach prometheus in one hop, a late sample no longer drops a whole batch, and the collector runs only what its pipelines use #1132 stops the out-of-order rejections (about 22 failed batches a day today). So fix(telemetry): devops-cli metrics reach prometheus in one hop, a late sample no longer drops a whole batch, and the collector runs only what its pipelines use #1132 merges first, or this rule starts withfor: 1hand tightens to 15m in fix(telemetry): devops-cli metrics reach prometheus in one hop, a late sample no longer drops a whole batch, and the collector runs only what its pipelines use #1132. The parent (refactor(k8s): the monitoring stack runs on k8s-monitoring and chart features, with no duplicate collection, dead defaults or leftovers #1128) orders fix(telemetry): devops-cli metrics reach prometheus in one hop, a late sample no longer drops a whole batch, and the collector runs only what its pipelines use #1132 first. - Does Pyroscope's ServiceMonitor need a network change? Proposed: no. Alloy and Pyroscope share the
monitoringnamespace, and the perimeter admits intra-namespace traffic.
Strategic alignment
- P2 feature: monitoring for the monitoring stack. Today, 73k dropped samples went unseen.
- Value: medium-high (a silent data loss becomes an alert, and feat(k8s): alert when pod logs stop reaching loki #890 is unblocked). Effort: S (values in two files, two rules, one test file).
- Library-first: the chart's
integrations.alloy/integrations.grafanaand the pyroscope chart's own ServiceMonitor. No hand-written scrape config. - Related: Metrics for the rest of the platform #551 (amended), feat(k8s): alert when pod logs stop reaching loki #890 (amended; depends on this item), feat(k8s): cluster deployment health diagnosis (
devops k8s doctor) #408 (a consumer of these health signals), fix(k8s): the prometheus server scrapes only itself and the otel collector, and k8s-monitoring discovers every other target #1130 (creates theintegrationsblock; merge after it), fix(telemetry): devops-cli metrics reach prometheus in one hop, a late sample no longer drops a whole batch, and the collector runs only what its pipelines use #1132 (removes the cause of the remote-write failures), feat(k8s): profiles come from k8s-monitoring's profiling feature for every workload, and the profiling dashboards list what is profiled #1134 (removes the extra Alloy instance).
Update 2026-10-08: refinement
#1129 adds no fixture, so this item adds the first: integrations/alloy.yaml's list from k8s-monitoring 4.5.2 with the version in its header, and a test that it equals the pin (commands/k8s/stack_lifecycle.py:101). #1136 uses the same format.
Proposed design
Problem statement
The Alloy collectors, Grafana and Pyroscope components are not being scraped by Prometheus, leading to silent data loss and lack of alerting. This issue affects monitoring of the monitoring stack itself.
Acceptance criteria
- Criterion 1: k8s-monitoring-values.yaml integrations block gains two instances with default allow lists
Verification: Verify that k8s/monitoring/k8s-monitoring-values.yaml contains an 'integrations' block with 'alloy' and 'grafana' instances, where 'alloy' has labelSelectors for alloy-metrics, alloy-logs, and alloy-singleton, and 'grafana' instance matches the Grafana pod. - Criterion 2: Pyroscope ServiceMonitor is enabled
Verification: Verify that k8s/monitoring/pyroscope-values.yaml sets serviceMonitor.enabled to true. - Criterion 3: Prometheus rules are added for Alloy remote write samples failed and log entries dropped
Verification: Verify that k8s/monitoring/prometheus-values.yaml contains a 'homelab-telemetry-pipeline' rule group with 'AlloyRemoteWriteSamplesFailed' and 'AlloyLogEntriesDropped' rules, each with appropriate severity and expressions. - Criterion 4: Test file asserts structural elements of the new configuration
Verification: Run tests/test_k8s_monitoring_alerting.py to verify that it asserts the two new rule names, expressions and severities, Alloy integration selector set, Grafana instance, and Pyroscope ServiceMonitor enabled status. - Criterion 5: Test verifies metric names in chart integration allow list
Verification: Run a test that reads integrations/alloy.yaml fixture and verifies each metric name used in new rules is in the chart's integration allow list.
Key questions
None.
Open questions
- Should this extend Metrics for the rest of the platform #551 instead of being a new item? (missing verified source)
- Should the log-pipeline-silence alert land here? (missing verified source)
- Would AlloyRemoteWriteSamplesFailed page from day one? (missing verified source)
- Does Pyroscope's ServiceMonitor need a network change? (missing verified source)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 18, 2026
Status set back to New at 25e2cda: refine found it not ready (see Key questions, Fit and Suspected block in the proposed design in the issue body).
dan-petty commentedon Oct 21, 2026
What changed
#1778, merged into
release/v0.2.38as 9804f5a.11 file(s) changed.
How it was verified
Check runs at ce261dd:
No task file.