Skip to content

fix: align dashboard job labels and ServiceMonitor names with actual … - #29269

Open
rseleven wants to merge 6 commits into
argoproj:masterfrom
rseleven:ix/align-dashboard-job-labels-with-service-names
Open

fix: align dashboard job labels and ServiceMonitor names with actual …#29269
rseleven wants to merge 6 commits into
argoproj:masterfrom
rseleven:ix/align-dashboard-job-labels-with-service-names

Conversation

@rseleven

@rseleven rseleven commented Aug 19, 2026

Copy link
Copy Markdown

…Service names

The Grafana dashboard used job labels that didn't match the Service names exposed by Argo CD. When deployed using the documented ServiceMonitor examples, Prometheus sets the job label to the ServiceMonitor metadata.name, which differed from the Service names the dashboard queries expected.

  • change dashboard job labels to match Service names:
    • argocd-application-controller-metrics → argocd-metrics
    • argocd-applicationset-controller-metrics → argocd-applicationset-controller
    • argocd-repo-server-metrics → argocd-repo-server
  • rename ServiceMonitors in docs to match Service names so job label is set correctly:
    • argocd-repo-server-metrics → argocd-repo-server
    • argocd-applicationset-controller-metrics → argocd-applicationset-controller
    • argocd-notifications-controller → argocd-notifications-controller-metrics
    • argocd-commit-server-metrics → argocd-commit-server

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

…Service names

The Grafana dashboard used job labels that didn't match the Service names
exposed by Argo CD. When deployed using the documented ServiceMonitor
examples, Prometheus sets the job label to the ServiceMonitor
metadata.name, which differed from the Service names the dashboard
queries expected.

- change dashboard job labels to match Service names:
  - argocd-application-controller-metrics → argocd-metrics
  - argocd-applicationset-controller-metrics → argocd-applicationset-controller
  - argocd-repo-server-metrics → argocd-repo-server
- rename ServiceMonitors in docs to match Service names so job label is
  set correctly:
  - argocd-repo-server-metrics → argocd-repo-server
  - argocd-applicationset-controller-metrics → argocd-applicationset-controller
  - argocd-notifications-controller → argocd-notifications-controller-metrics
  - argocd-commit-server-metrics → argocd-commit-server

Signed-off-by: rseleven <73898556+rseleven@users.noreply.github.com>
@rseleven
rseleven requested review from a team as code owners August 19, 2026 15:59
@bunnyshell

bunnyshell Bot commented Aug 19, 2026

Copy link
Copy Markdown

✅ Preview Environment deployed on Bunnyshell

Component Endpoints
argocd https://argocd-rgj67e.bunnyenv.com/
argocd-ttyd https://argocd-web-cli-rgj67e.bunnyenv.com/

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔴 /bns:stop to stop the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Align dashboard job labels with Argo CD service names

🐞 Bug fix 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Align dashboard PromQL filters with controller, ApplicationSet, and repository Service names.
• Rename documented ServiceMonitors so Prometheus emits dashboard-compatible job labels.
• Match notifications and commit-server monitor names with their deployed Services.
Diagram

sequenceDiagram
  participant M as Documented ServiceMonitors
  participant O as Prometheus Operator
  participant P as Prometheus
  participant S as Argo Services
  participant D as Grafana Dashboard
  O->>M: Watch monitor definitions
  O->>P: Configure named jobs
  P->>S: Scrape metrics
  S-->>P: Expose telemetry
  D->>P: Query aligned jobs
  P-->>D: Return telemetry
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Set ServiceMonitor jobLabel explicitly
  • ➕ Decouples ServiceMonitor resource names from Prometheus job labels.
  • ➕ Makes the intended label source explicit in every example.
  • ➖ Adds configuration to every documented ServiceMonitor.
  • ➖ Custom monitors must preserve the same jobLabel setting for dashboard compatibility.
2. Accept legacy and current job names
  • ➕ Keeps dashboards compatible with existing ServiceMonitor names.
  • ➕ Avoids requiring users to rename deployed monitor resources immediately.
  • ➖ Makes PromQL filters longer and harder to maintain.
  • ➖ Preserves inconsistent naming instead of establishing one convention.

Recommendation: The PR's naming alignment is the best focused fix because it works with Prometheus Operator defaults and keeps the examples simple. Explicit jobLabel configuration could provide a stronger long-term contract, but it adds complexity that is unnecessary when monitor and Service names can consistently match.

Files changed (2) +12 / -12

Bug fix (1) +8 / -8
dashboard.jsonCorrect component job filters in telemetry panels +8/-8

Correct component job filters in telemetry panels

• Updates memory, CPU, and goroutine queries for the application controller and ApplicationSet controller, plus memory and goroutine queries for the repository server. The new filters match job labels generated from the documented ServiceMonitor names.

examples/dashboard.json

Documentation (1) +4 / -4
metrics.mdAlign example ServiceMonitor names with metric Services +4/-4

Align example ServiceMonitor names with metric Services

• Renames the repository, ApplicationSet, notifications, and commit-server ServiceMonitor examples to match their selected Kubernetes Service names. This ensures default Prometheus job labels follow the naming expected by dashboards.

docs/operator-manual/metrics.md

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. Dashboard queries changed without tests 📘 Rule violation ☼ Reliability
Description
The PR changes Grafana dashboard PromQL job selectors, altering which metrics panels display, but
adds or updates no unit/e2e test covering the corrected selectors. This leaves the dashboard
behavior change without automated regression coverage.
Code

examples/dashboard.json[1561]

+              "expr": "go_memstats_heap_alloc_bytes{job=\"argocd-metrics\",namespace=~\"$namespace\"}",
Evidence
PR Compliance ID 4 requires relevant unit/e2e tests when functionality or behavior changes. The
changed dashboard expression at the cited line changes the job label used to select Prometheus
metrics, while the supplied PR diff contains no test additions or updates.

AGENTS.md: Add or update unit/e2e tests when functionality or behavior changes
examples/dashboard.json[1561-1561]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The dashboard PromQL job label was changed without automated coverage for the new selector.

## Issue Context
The PR changes multiple dashboard queries from metric ServiceMonitor names to Service names; tests should verify that the expected job labels remain present in the dashboard definition.

## Fix Focus Areas
- examples/dashboard.json[1561-1561]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: 🚀 Fast: This is a localized, low-risk rename-only fix across dashboard queries and documentation examples, with no runtime or security-sensitive logic.

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread examples/dashboard.json
"uid": "$datasource"
},
"expr": "go_memstats_heap_alloc_bytes{job=\"argocd-application-controller-metrics\",namespace=~\"$namespace\"}",
"expr": "go_memstats_heap_alloc_bytes{job=\"argocd-metrics\",namespace=~\"$namespace\"}",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Dashboard queries changed without tests 📘 Rule violation ☼ Reliability

The PR changes Grafana dashboard PromQL job selectors, altering which metrics panels display, but
adds or updates no unit/e2e test covering the corrected selectors. This leaves the dashboard
behavior change without automated regression coverage.
Agent Prompt
## Issue description
The dashboard PromQL job label was changed without automated coverage for the new selector.

## Issue Context
The PR changes multiple dashboard queries from metric ServiceMonitor names to Service names; tests should verify that the expected job labels remain present in the dashboard definition.

## Fix Focus Areas
- examples/dashboard.json[1561-1561]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.55%. Comparing base (ebcbc95) to head (a6df2a2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #29269      +/-   ##
==========================================
+ Coverage   65.54%   65.55%   +0.01%     
==========================================
  Files         427      427              
  Lines       60659    60659              
==========================================
+ Hits        39757    39767      +10     
+ Misses      17264    17255       -9     
+ Partials     3638     3637       -1     
Flag Coverage Δ
e2e 26.74% <ø> (-0.01%) ⬇️
unit-tests 61.16% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant