Skip to content

feat(k8s): the alloy collectors, grafana and pyroscope are scraped through chart integrations, and a dropped sample or log entry alerts #1131

Closed

Description

@dan-petty

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.

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

Key questions

Strategic alignment

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

#1132, #1134

Activity

  1. added
    type/feature
    scope/k8s
    scope/telemetry
    priority/p2-medium
    on Oct 3, 2026
  2. added this to the v0.2.38 milestone on Oct 17, 2026
  3. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    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).

  4. modified the milestone: v0.2.38 on Oct 20, 2026
  5. dan-petty commented on Oct 21, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1778, merged into release/v0.2.38 as 9804f5a.

    Closes #1131
    Part of #1128

    11 file(s) changed.

    How it was verified

    Check runs at ce261dd:

    • Fail-to-Pass Check: pass
    • Fail-to-Pass Self-Check: pending
    • Audit Defect PR Hardening: skipping
    • Prune PR DevContainer Images: pass
    • zizmor: pass
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Rule Pack Tests: pass
    • Static Analysis: pass
    • Analyze (python): pass
    • Tests & Coverage: pass
    • Changed-Test Independence: pass
    • Analyze (actions): pass
    • Dependency Freshness: skipping
    • Service Image: skipping
    • DevContainer Image: skipping

    No task file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2-mediumscope/k8sscope/telemetrytype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions