Repository navigation
Description
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 thePendingqueue. 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
rowandrepoare enough. - Measure the API-server requests and the new metric series for 100
devops-cli-noopWorkflows in 1 hour.
Acceptance criteria
- A
promtool test rulescase 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-noopWorkflows in 1 hour. - Live check after the release: the series of one unit stay in the budget.
Dependencies
- feat(monitoring): record the shared roadmap Service selectors #4562
- feat(k8s): let Argo Workflows run roadmap pods in devops #4566
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.yamlruns the fixtureup{namespace="argo-workflows"} 0against theargo-workflowsgroup. - THEN promtool reports
SUCCESS, and thealert_rule_testforArgoWorkflowsControllerDownpasses with the alert in statefiring.
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.yamlruns a fixture with the controller's Workflow series for oneFailedWorkflow. - THEN promtool reports
SUCCESS, and thealert_rule_testforArgoWorkflowsFailedWorkflowpasses with the alert in statefiring.
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.yamlruns a fixture with one Workflow in thePendingqueue past the threshold. - THEN promtool reports
SUCCESS, and thealert_rule_testforArgoWorkflowsPendingQueueOldpasses with the alert in statefiring.
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.yamlruns a fixture with the controller up, no failed Workflow and no old pending Workflow. - THEN promtool reports
SUCCESS, and eachalert_rule_testentry 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.pyruns. - THEN the run passes, including
test_every_alert_rule_selects_only_series_the_stack_servesfor theargo-workflowsgroup.
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 k8sruns the gate check of the Workflow pod templates. - THEN the row passes, and its check reports
OTEL_RESOURCE_ATTRIBUTESwith a stableservice.instance.idon 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.pyruns the resource test withOTEL_RESOURCE_ATTRIBUTEScarryinghost.nameandk8s.pod.name. - THEN the test passes, and the exported metric Resource holds no
host.nameork8s.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 thoseargo_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.
- Chosen:
- 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-workflowsgroup ofk8s/devops/monitoring/prometheus-rules-values.yaml, the product values file whoseserverFiles.devops_cli_alerting_rules.ymlthe Prometheus server loads. The fixtures go intests/fixtures/prometheus_rules/argo_workflows_tests.yaml, registered inRULE_GROUP_TESTSoftests/prometheus/test_k8s_monitoring_alerting.py, and the Argo series joinSERVED_SERIESthere. Thek8s/devops/alerts/PrometheusRule is not in the server'srule_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_SERIEScheck read the same file. - Rejected:
k8s/devops/alerts/PrometheusRule. The server'srule_filesdoes 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.
- Chosen: Product values file plus promtool fixtures. The server loads the product values file, and the promtool tests and
- Which labels does the OTLP export of a unit drop, and what budget does that set?: The metric Resource keeps only
service.name(thejoblabel),service.namespace,service.instance.id(theinstancelabel),os.typeand thetelemetry.sdk.*keys. The collector deleteshost.name, the pod name, from devops-cli metric Resources, and the/metricsscrape'spodlabel is not on the OTLP path; the collector runs nok8sattributesprocessor, sopod_template_hashandcontainernever enter the Resource. The remaining per-pod label isinstance: withoutOTEL_RESOURCE_ATTRIBUTES,service.instance.idis the host name. The change setsOTEL_RESOURCE_ATTRIBUTES=service.instance.id=<stable unit name>in each unit Workflow pod template, as the CronJob templates do, sorowandrepoidentify 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.idper unit and keep the metric Resource allowlist. Prometheus keys a series byjobandinstance; a stable instance keeps the per-pod name out of the series whilerowandrepoidentify the unit. - Rejected: Drop
pod,pod_template_hash,instanceandcontainerat the exporter.podis only the/metricsscrape label,pod_template_hashandcontainernever enter the OTLP Resource, andinstanceis the series key that Prometheus needs. - Rejected: Keep the labels and cap the series count. A cap drops data and keeps the cardinality.
- Chosen: Set a stable
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 21, 2026
Both items operate Argo Workflows in devops. 4570 gives read access in the Argo UI. The candidate adds alerts and a metric budget.devops-cli-service commentedon Nov 21, 2026
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:
Sources:
devops-cli-service commentedon Nov 22, 2026
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.