Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add metric to expose Applications conditions #19438

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

foyerunix
Copy link
Contributor

Hello,

Closes #13096

Implement a new metric exposing Applications conditions. This is particularly useful for SRE teams to be able to setup alerts on issues that aren't displayed via "health_status" and "sync_status" in the metric "argocd_app_info".

Our use case is similar to #13096. We want to ensure flawless reinstallation of our Kubernetes clusters. To do this we need to take care to not have some resources that for some reason aren't managed by ArgoCD but that end up being necessary for our workloads to run properly.

Best Regards.

@foyerunix foyerunix requested review from a team as code owners August 8, 2024 07:36
Copy link

bunnyshell bot commented Aug 8, 2024

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Copy link

bunnyshell bot commented Aug 8, 2024

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Copy link

codecov bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 55.90%. Comparing base (5834175) to head (0beb22d).
Report is 40 commits behind head on master.

Files with missing lines Patch % Lines
cmd/argocd/commands/admin/app.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19438      +/-   ##
==========================================
+ Coverage   55.83%   55.90%   +0.07%     
==========================================
  Files         320      320              
  Lines       44041    44061      +20     
==========================================
+ Hits        24589    24634      +45     
+ Misses      16896    16871      -25     
  Partials     2556     2556              

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

@ilia-medvedev-codefresh
Copy link
Contributor

@foyerunix I think the current implementation does not take into account that a condition can appear more than just one time. For example an application can have multiple excluded resources and those would all be appended to the application status

conditions = append(conditions, v1alpha1.ApplicationCondition{
.
You should instead count the appearances of each condition and increase the gauge value accordingly.

Another concern I have about this is scale. An application can potentially have 9 different condition types and more can be added in the future. This change would generate a gauge per each existing status. Perhaps we should add a parameter with a whitelist of statuses that we want to collect, similar to how it's done with application labels.

@foyerunix foyerunix marked this pull request as draft September 2, 2024 09:05
@foyerunix foyerunix force-pushed the add-orphaned-metric branch 2 times, most recently from 45bdae4 to d1b7b1f Compare September 2, 2024 10:40
Closes argoproj#13096

Implement a new metric exposing Applications conditions.
This is particularly useful for SRE teams to be able
to setup alerts on issues that aren't displayed via
"health_status" and "sync_status" in the metric "argocd_app_info".

Signed-off-by: Foyer Unix <foyerunix@foyer.lu>
@foyerunix
Copy link
Contributor Author

Hello @ilia-medvedev-codefresh,

I took into account your propositions and updated the pull request.

Best Regards.

@foyerunix foyerunix marked this pull request as ready for review September 2, 2024 11:45
Copy link
Member

@pasha-codefresh pasha-codefresh left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@pasha-codefresh pasha-codefresh merged commit de35745 into argoproj:master Sep 5, 2024
27 of 28 checks passed
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.

Info about orphaned resources in metrics
3 participants