Skip to content

prometheus: Safely detect Argo CD Application metrics - #1227

Open
Joshna907 wants to merge 1 commit into
headlamp-k8s:mainfrom
Joshna907:codex/prometheus-argocd-metrics-guard
Open

prometheus: Safely detect Argo CD Application metrics#1227
Joshna907 wants to merge 1 commit into
headlamp-k8s:mainfrom
Joshna907:codex/prometheus-argocd-metrics-guard

Conversation

@Joshna907

Copy link
Copy Markdown
Contributor

Summary

Adds a safe Prometheus metrics eligibility check for Argo CD Applications.

This is the first half of Argo CD metrics support. It only recognizes the exact argoproj.io/v1alpha1 Application resource, so another Kubernetes resource with the same kind name cannot receive Argo CD metric charts by mistake.

Changes

  • Add Application to the supported Prometheus resource kinds.
  • Require the exact argoproj.io/v1alpha1 API version.
  • Add positive and negative unit coverage.

Validation

  • TypeScript passed.
  • ESLint passed with zero warnings.
  • Tests passed.
  • Production build passed.

Follow-up

The chart UI itself is deliberately in a separate follow-up PR, matching the earlier Volcano metrics work.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds strict Argo CD Application identification to Prometheus resource eligibility.

Changes:

  • Allows Applications with exact argoproj.io/v1alpha1.
  • Adds positive and negative unit coverage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
prometheus/src/util.ts Adds Application API-version validation and eligibility.
prometheus/src/util.test.ts Tests Argo CD and same-kind non-Argo Applications.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread prometheus/src/util.ts Outdated
Signed-off-by: Joshna907 <joshnawaikar@gmail.com>
@Joshna907
Joshna907 force-pushed the codex/prometheus-argocd-metrics-guard branch from cca871f to aff56e0 Compare August 25, 2026 09:19
@illume
illume requested a balanced review from Copilot August 25, 2026 09:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@Joshna907

Copy link
Copy Markdown
Contributor Author

Let's merge this @illume ?

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.

2 participants