Skip to content

Metrics for the rest of the platform #551

Closed

Description

@dan-petty

Beyond Kubernetes itself, Prometheus scraped only Qdrant and the OpenTelemetry collector, and both scrape jobs lived in the kube-prometheus-stack values that #734 removed; the Prometheus and Alloy values that replaced them define neither. These run unmonitored:

  • ArgoCD, which has built-in metrics endpoints;
  • cloudflared;
  • Valkey;
  • the image registry;
  • fluent-bit, Loki and Jaeger themselves;
  • Qdrant and the OpenTelemetry collector.

Deliverables

Monitoring cleanup amendment (2026-10-03): scope update

Live targets show that some components listed as unmonitored are scraped today, and others move to chart features in the monitoring cleanup (#1128):

Remaining here: ArgoCD, Valkey (maintained exporter) and the registry, plus the ArgoCD sync, tunnel health and cache-error dashboards and alerts.

Acceptance criteria (added).

Grouping. This item is a child of #1128 and lands after #1130. It is no longer the parent of #822 and #823; both are children of #1128. The scrape #890 needs comes from #1131, not from this item.

Proposed design

Problem statement

The platform lacks comprehensive monitoring for several key components beyond Kubernetes itself, including ArgoCD, cloudflared, Valkey, the image registry, fluent-bit, Loki, Jaeger, and Qdrant. This issue aims to implement proper metrics collection and dashboards for these components using k8s-monitoring features.

Acceptance criteria

  • Criterion 1: Each new target has exactly one scrape owner and each scrape port has exactly one monitoring egress rule
    Verification: Verify that the Prometheus configuration in k8s-monitoring uses annotationAutodiscovery, integrations, or prometheusOperatorObjects for new scrapes, and check that no duplicate or conflicting scrape configurations exist.
  • Criterion 2: New scrapes use k8s-monitoring features instead of server-side scrape jobs
    Verification: Examine the monitoring configuration files to confirm that new scrape jobs are defined using k8s-monitoring features rather than being added directly to the Prometheus server's configuration.
  • Criterion 3: ArgoCD, Valkey, and registry components have appropriate monitoring with dashboards or alerts
    Verification: Check that ServiceMonitors or exporters exist for ArgoCD, Valkey, and the image registry, and verify that dashboards or alerts are implemented for sync status, health, tunnel health, and cache errors.

Key questions

  • What monitoring features should be used for new scrapes?: New scrapes should use k8s-monitoring features such as annotationAutodiscovery, integrations, or ServiceMonitors through prometheusOperatorObjects, not server-side scrape jobs. [sources: k8s/monitoring/k8s-monitoring-values.yaml:146]
  • Should annotations be used for all new monitoring targets?: Annotations should only be used for documented exceptions, as specified in fix(k8s): the prometheus server scrapes only itself and the otel collector, and k8s-monitoring discovers every other target #1130's ownership table. [sources: docs/agent/tasks/task-1130-prometheus-scrapes-itself-and-the-collector.md:24]

Open questions

  • What specific components need to be monitored beyond Kubernetes? (missing verified source)
  • Which components have built-in metrics endpoints and which need exporters? (missing verified source)
  • What dashboards or alerts are required for ArgoCD? (missing verified source)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#1128

Activity

  1. added this to the v0.2.24 milestone on Sep 24, 2026
  2. added
    type/feature
    scope/k8s
    priority/p2-medium
    on Sep 24, 2026
  3. modified the milestones: v0.2.24, v0.2.25 on Sep 30, 2026
  4. dan-petty commented on Sep 30, 2026

    @dan-petty
    OwnerAuthor

    Moved from v0.2.25 to the backlog. v0.2.25 is capped at 12 items (#740), and only the next two planned releases keep a milestone (#739), so P2 items wait in the backlog until reprioritization pulls them in.

  5. added
    scope/telemetry
    on Oct 2, 2026
  6. modified the milestones: v0.2.39, v0.2.38 on Oct 17, 2026
  7. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Update 2026-10-18 from a read-only cluster audit (main 3dd7fa6). These details are for the Argo CD part of this item.

    • Nothing is scraped yet. list_prometheus_metric_names for ^argocd_.* over 7d returns nothing, and up{namespace="argocd"} is empty. The pods declare their metrics ports: application-controller 8082, server 8083 (--metrics-port=8083), repo-server 8084, applicationset-controller 8080, image-updater 8443. k8s/monitoring/networkpolicy.yaml restricts monitoring's egress and admits none of these toward argocd, so each scrape port needs its egress rule, as this item's criteria already require. k8s-monitoring-values.yaml:146-148 already enables prometheusOperatorObjects, so turning on the argo-cd chart's *.metrics.serviceMonitor.enabled is discovered without new Alloy config.
    • Ingress side. The argocd namespace's argocd-default-perimeter is not live on the homelab (filed separately: deploy-stack skips it on an Argo CD-managed cluster and no Application syncs it). When it lands it admits monitoring on 8082/8084/9121 only, so 8083 (server), 8080 (applicationset) and 8443 (image-updater) must be added with the scrape.
    • Alerts that would have caught this week's problems (they notify nobody until feat(k8s): alertmanager posts critical and warning alerts to mattermost's alerts channel, and a roadmap service repository whose rounds all fail for an hour alerts #1392):
      • A sync operation running too long. Application k8s-monitoring's sync ran from 2026-10-11 to 2026-10-17, waiting on the node-exporter DaemonSet on two dead nodes. argocd_app_info carries an operation label while an operation runs, which is enough to alert on one running for more than about an hour.
      • An Application whose automated sync is off. Application devops has had automated.enabled: false since 2026-10-11 (the chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562 stop that was never undone; filed separately). argocd_app_info{autosync_enabled="false"} would show it.
      • An Application OutOfSync or Degraded for longer than a window, as this item already plans.
    • Image Updater exposes its own metrics on 8443 (argocd_image_updater_*). It reported Ready while it skipped the devops image for six days (filed separately). A scrape plus an alert on zero managed images would catch that class.
  8. modified the milestones: v0.2.38, on Oct 20, 2026
  9. modified the milestones: , v0.2.38 on Oct 21, 2026
  10. dan-petty commented on Oct 21, 2026

    @dan-petty
    OwnerAuthor

    Checked on release/v0.2.38 at 14d4490, 2026-10-22. What the amendment left here is delivered by #1789 (Part 7 of #1128):

    • Scrapes, one owner each:
      • Argo CD: ServiceMonitors for the controller (8082), server (8083), repo-server (8084) and the Redis exporter (9121).
      • Valkey: a redis-exporter sidecar, scraped through annotationAutodiscovery.
      • The registry: Distribution's Prometheus debug endpoint on 5001, through annotationAutodiscovery.
    • Egress: the monitoring NetworkPolicy has one rule per new scrape port.
    • Acceptance tests: the two criteria added in the amendment are test_each_annotated_component_has_one_scrape_owner and test_every_scrape_port_has_one_egress_rule in tests/test_k8s_monitoring_integration.py.
    • Alerts: the homelab-services rule group holds ArgoCdApplicationOutOfSync, ArgoCdApplicationUnhealthy, CloudflareTunnelDegraded and ValkeyCacheErrors. The deliverable asks for "dashboards or alerts".

    No dashboard for Argo CD sync or for Valkey cache errors exists, and the tunnel's is ingress-tunnel.json. If a dashboard is wanted beyond the alerts, it is a new item with its own capture fixture for the dashboard metric test.

    Pending a person: after the next deploy, the four alerts' expressions return series, for example argocd_app_info and redis_up.

  11. added a commit that references this issue on Oct 21, 2026
    d09a028
  12. dan-petty commented on Oct 21, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1797, merged into release/v0.2.38 as d09a028.

    Closes #551

    5 file(s) changed.

    How it was verified

    Check runs at 66887af:

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

    Acceptance Criteria of docs/agent/tasks/task-551-metrics-for-the-rest-of-the-platform.md:

    • New scrapes use k8s-monitoring features (annotationAutodiscovery for valkey and registry, and chart ServiceMonitors through prometheusOperatorObjects for argocd), not server-side scrape jobs (tests/test_k8s_monitoring_integration.py).
    • Each new target has exactly one scrape owner (test_each_annotated_component_has_one_scrape_owner), and each new scrape port has exactly one monitoring egress rule (test_every_scrape_port_has_one_egress_rule).
    • homelab-services alerts cover Argo CD sync/health/autosync/stuck operations, Cloudflare Tunnel HA connectivity, and Valkey cache errors (tests/test_k8s_monitoring_alerting.py).
    • Pending a person: after the next deploy, the homelab-services alerts' expressions return series, for example argocd_app_info and redis_up.
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