Skip to content

[Backport v0.11] Add dry_run label to all WPA Prometheus metrics#341

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intov0.11from
backport-321-to-v0.11
Apr 9, 2026
Merged

[Backport v0.11] Add dry_run label to all WPA Prometheus metrics#341
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intov0.11from
backport-321-to-v0.11

Conversation

@dd-octo-sts
Copy link
Copy Markdown

@dd-octo-sts dd-octo-sts bot commented Apr 9, 2026

Backport 87168a7 from #321.


Human-written intent

Add dry_run tag to all metrics to make it easier to filter by the enabled WPA when graphing various WPA metrics. The PR updates what I believe to be all the relevant places.

AI-written Summary

  • Adds a dry_run label ("true"/"false") to all WPA Prometheus metrics, making it trivial to filter/group dashboards and alerts by dry-run state without needing a join on the separate dry_run gauge metric.
  • The label is added to defaultPromLabels and to the custom label sets used by lifecycleControlStatus and labelsInfo.

Test plan

  • go build ./... compiles
  • go test ./controllers/datadoghq/ passes

🤖 Generated with Claude Code

AI assessment of Intent vs Implementation

Verdict: Implementation matches intent. The dry_run label is added to all three label sets (defaultPromLabels, lifecycleControlStatus, labelsInfo) and populated consistently via strconv.FormatBool(wpa.Spec.DryRun) across all metric emission and cleanup paths. Tests are updated accordingly.

The value GaugeVec now includes dryRunPromLabel in its label list via
defaultPromLabels. The three Delete() calls in replica_calculator.go
used incomplete 2-key label maps, which would silently no-op since
Prometheus requires an exact match on all declared labels. Use
getPrometheusLabels(wpa) to provide the full label set.

Co-authored-by: Claude Opus 4.6 <[email protected]>
(cherry picked from commit 87168a7)
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d bot merged commit 1ed4511 into v0.11 Apr 9, 2026
40 of 50 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d bot deleted the backport-321-to-v0.11 branch April 9, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants