Skip to content

feat(monitoring): alert on Argo Workflows in devops #6595

Open

Description

@dan-petty

Problem

The refine split of #4566 on 2026-11-14 gives this part its own item. After #4566, the Argo Workflows controller runs the roadmap Workflows in devops. No alert shows a controller that is down, a failed Workflow or a Workflow that waits too long in the Pending queue. CronWorkflow rag-ingest has never run, and no alert showed it (evidence of 2026-11-11 on #4566).

Scope

  • Add three alerts: controller up == 0, failed Workflows, and the age of the Pending queue. The alerts read the recorded series of feat(monitoring): record the shared roadmap Service selectors #4562.
  • Set a metric series budget: the OTLP export of a unit drops the per-pod labels where row and repo are enough.
  • Measure the API-server requests and the new metric series for 100 devops-cli-noop Workflows in 1 hour.

Acceptance criteria

  • A promtool test rules case fires each alert on a fixture series. It does not fire the alert on a healthy series.
  • A comment on this issue gives the measured API-server requests and metric series for 100 devops-cli-noop Workflows in 1 hour.
  • Live check after the release: the series of one unit stay in the budget.

Dependencies

Source

Source: #4517

Alternatives check of 2026-11-21: partly.
Tool: adinhodovic/argo-workflows-mixin (https://github.com/adinhodovic/argo-workflows-mixin), Apache-2.0, last activity 2026-04-05, maintained.
Reason: Searches found adinhodovic/argo-workflows-mixin, an Apache-2.0 Jsonnet mixin shipping Prometheus alert rules and Grafana dashboards for Argo Workflows, which covers the controller and Workflow alerts but not the metric budget, promtool tests or the measurement.

Covers:

  • Prometheus alert rules for Argo Workflows controller and Workflows
  • Grafana dashboards generated from the same Jsonnet mixin
  • Alert names and labels follow monitoring-mixins guidelines

Lacks:

  • No promtool rule tests or fixture series
  • No metric series budget or per-pod label drop for OTLP
  • No measurement of API-server requests for 100 Workflows

Proposed design

Problem statement

The Argo Workflows controller runs the roadmap Workflows in the devops namespace. No alert shows a controller that is down, a failed Workflow or a Workflow that waits too long in the Pending queue. Each unit pod also writes its own instance, so the OTLP series multiply per pod. No fixture test and no measured budget guard the rules.

Acceptance criteria

Requirement: Argo Workflows controller down alert

The shipped Argo Workflows rule group SHALL fire an alert when the controller's up series is 0.

Scenario: Controller down

  • WHEN promtool test rules tests/fixtures/prometheus_rules/argo_workflows_tests.yaml runs the fixture up{namespace="argo-workflows"} 0 against the argo-workflows group.
  • THEN promtool reports SUCCESS, and the alert_rule_test for ArgoWorkflowsControllerDown passes with the alert in state firing.

Requirement: Failed Workflow alert

The rule group SHALL fire an alert when a Workflow ends in the Failed phase.

Scenario: Failed Workflow

  • WHEN promtool test rules tests/fixtures/prometheus_rules/argo_workflows_tests.yaml runs a fixture with the controller's Workflow series for one Failed Workflow.
  • THEN promtool reports SUCCESS, and the alert_rule_test for ArgoWorkflowsFailedWorkflow passes with the alert in state firing.

Requirement: Pending queue age alert

The rule group SHALL fire an alert when a Workflow stays in the Pending queue longer than the threshold.

Scenario: Old pending Workflow

  • WHEN promtool test rules tests/fixtures/prometheus_rules/argo_workflows_tests.yaml runs a fixture with one Workflow in the Pending queue past the threshold.
  • THEN promtool reports SUCCESS, and the alert_rule_test for ArgoWorkflowsPendingQueueOld passes with the alert in state firing.

Requirement: No alert on a healthy series

The rule group SHALL NOT fire any of the three alerts on a healthy series.

Scenario: Healthy series

  • WHEN promtool test rules tests/fixtures/prometheus_rules/argo_workflows_tests.yaml runs a fixture with the controller up, no failed Workflow and no old pending Workflow.
  • THEN promtool reports SUCCESS, and each alert_rule_test entry for the three alerts with no expected alert passes.

Requirement: Product rule file and served series

The Argo Workflows alerts MUST be part of the product rule file that the Prometheus server loads, and every series they select MUST be listed as served.

Scenario: Rule file check

  • WHEN uv run devops ci test tests/prometheus/test_k8s_monitoring_alerting.py runs.
  • THEN the run passes, including test_every_alert_rule_selects_only_series_the_stack_serves for the argo-workflows group.

Requirement: Stable unit metric stream

Each Workflow pod template that runs a devops-cli unit MUST set OTEL_RESOURCE_ATTRIBUTES to a stable service.instance.id, so its OTLP series carries no per-pod instance.

Scenario: Unit pod environment

  • WHEN uv run devops ci --check --only k8s runs the gate check of the Workflow pod templates.
  • THEN the row passes, and its check reports OTEL_RESOURCE_ATTRIBUTES with a stable service.instance.id on each unit Workflow pod template.

Requirement: Metric Resource allowlist

The metric Resource of a devops-cli process SHALL keep only service.name, service.namespace, service.instance.id, os.type and the telemetry.sdk.* keys.

Scenario: Pod attributes in the environment

  • WHEN uv run devops ci test tests/telemetry/test_telemetry.py runs the resource test with OTEL_RESOURCE_ATTRIBUTES carrying host.name and k8s.pod.name.
  • THEN the test passes, and the exported metric Resource holds no host.name or k8s.pod.name.

Existing Tool Considered

adinhodovic/argo-workflows-mixin, Apache-2.0, last activity 2026-04-05, maintained (https://github.com/adinhodovic/argo-workflows-mixin, fetched 2026-11-22): the alternatives block of the issue body gives the verdict partly and states what the mixin lacks. The plan renders its alert expressions into the argo-workflows group of k8s/devops/monitoring/prometheus-rules-values.yaml, keeps its alert names and labels, and adds what the block names. The measurement goes to a deferred issue.

Key questions

  • Which series do the three alerts read?: The controller-down alert reads up{namespace="argo-workflows"} == 0, the series that the install's live check queries. The failed-Workflow and pending-queue alerts read the Argo Workflows controller's own Workflow series, whose names and thresholds are in the mixin's rule expressions; the promtool fixture pins them, and feat(monitoring): record the shared roadmap Service selectors #4562 records them. No file in this checkout names those argo_workflows_* series yet, so the plan does not restate them. (best practice) [sources: k8s/README.md:882, k8s/argo-workflows/values.yaml:43, k8s/README.md:868, tests/prometheus/test_k8s_monitoring_alerting.py:148, https://github.com/adinhodovic/argo-workflows-mixin]
    • Chosen: up{namespace="argo-workflows"} for the controller, and the mixin's Workflow series for the other two. The install's live check names the controller target by namespace, and the controller's Workflow series come from the maintained mixin that the plan renders.
    • Rejected: up{job=...} for the controller. No file in this checkout names the controller's job label, while the live check and the perimeter name the namespace.
    • Rejected: kube-state-metrics Workflow phase series. kube-state-metrics scrapes no Argo Workflow custom resource here.
  • Which open, maintained tool covers the Argo Workflows alerts?: adinhodovic/argo-workflows-mixin, Apache-2.0, last activity 2026-04-05, maintained (fetched 2026-11-22). The alternatives block gives the verdict partly and states what the mixin lacks; the plan renders its alert expressions and adds what the block names. (best practice) [sources: https://github.com/adinhodovic/argo-workflows-mixin]
    • Chosen: Adopt the mixin and render its alert expressions. It is Apache-2.0, maintained, and its rules follow the monitoring-mixins guidelines.
    • Rejected: Write the three alert expressions in devops-cli. It repeats a maintained rule set and gives no fixture tests either.
    • Rejected: Use the kube-prometheus-stack default rules. That chart ships no Argo Workflows rules.
  • Where do the alert rules and their promtool fixtures live?: The alerts go in a new argo-workflows group of k8s/devops/monitoring/prometheus-rules-values.yaml, the product values file whose serverFiles.devops_cli_alerting_rules.yml the Prometheus server loads. The fixtures go in tests/fixtures/prometheus_rules/argo_workflows_tests.yaml, registered in RULE_GROUP_TESTS of tests/prometheus/test_k8s_monitoring_alerting.py, and the Argo series join SERVED_SERIES there. The k8s/devops/alerts/ PrometheusRule is not in the server's rule_files, so the alerts do not go there. (best practice) [sources: tests/prometheus/test_k8s_monitoring_alerting.py:69, tests/prometheus/test_k8s_monitoring_alerting.py:129, tests/prometheus/test_k8s_monitoring_alerting.py:145, k8s/devops/monitoring/prometheus-rules-values.yaml:1, docs/CLUSTER.md:172]
    • Chosen: Product values file plus promtool fixtures. The server loads the product values file, and the promtool tests and SERVED_SERIES check read the same file.
    • Rejected: k8s/devops/alerts/ PrometheusRule. The server's rule_files does not load it, and the promtool tests read only the product values file.
    • Rejected: Environment values file k8s/monitoring/prometheus-values.yaml. Product rules stay in devops-cli, as the product values file records.
  • Which labels does the OTLP export of a unit drop, and what budget does that set?: The metric Resource keeps only service.name (the job label), service.namespace, service.instance.id (the instance label), os.type and the telemetry.sdk.* keys. The collector deletes host.name, the pod name, from devops-cli metric Resources, and the /metrics scrape's pod label is not on the OTLP path; the collector runs no k8sattributes processor, so pod_template_hash and container never enter the Resource. The remaining per-pod label is instance: without OTEL_RESOURCE_ATTRIBUTES, service.instance.id is the host name. The change sets OTEL_RESOURCE_ATTRIBUTES=service.instance.id=<stable unit name> in each unit Workflow pod template, as the CronJob templates do, so row and repo identify the series and every pod of the workload shares one stream. ADR 0021 measured about 76 series for each short pod before the drop; the count after the drop is one series for each metric and label set of a unit, and the deferred measurement records the exact budget. (best practice) [sources: docs/TELEMETRY.md:25, docs/TELEMETRY.md:37, docs/TELEMETRY.md:48, src/devops_cli/telemetry/tracer.py:262, src/devops_cli/telemetry/tracer.py:1108, k8s/otel/values.yaml:36, k8s/otel/values.yaml:90, k8s/devops/cronjob.yaml:73, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:279]
    • Chosen: Set a stable service.instance.id per unit and keep the metric Resource allowlist. Prometheus keys a series by job and instance; a stable instance keeps the per-pod name out of the series while row and repo identify the unit.
    • Rejected: Drop pod, pod_template_hash, instance and container at the exporter. pod is only the /metrics scrape label, pod_template_hash and container never enter the OTLP Resource, and instance is the series key that Prometheus needs.
    • Rejected: Keep the labels and cap the series count. A cap drops data and keeps the cardinality.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4562, #4566

Activity

  1. added
    type/feature
    source/agent
    status/new
    value/medium
    effort/medium
    scope/monitoring
    on Nov 21, 2026
  2. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 21, 2026
  4. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • argo-workflows helm chart prometheus rules alerts mixin, results: 5
    • prometheus alerting rules Argo Workflows controller down failed workflow pending queue, results: 5
    • awesome-prometheus-alerts argo-workflows alert rules, results: 5
    • "argo-workflows" metrics prometheus "Pending" workflow queue alert github, results: 5
    • kubernetes prometheus alert rules library github, results: 5
    • Argo Workflows, results: 5
    • prometheusrule argo workflows controller alerts, results: 5
    • argo-workflows-monitoring, results: 5
    • argo-workflows-mixin alerts ArgoWorkflowsControllerDown ArgoWorkflowsTooManyPending, results: 5
    • awesome-prometheus-alerts argo workflows rules "workflow" controller, results: 5

    Sources:

  5. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

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

    effort/mediumpriority/p2-mediumscope/monitoringsource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions