argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.08k stars 5.53k forks source link

Additional Application metrics. #18485

Open CaMoPeZzz opened 6 months ago

CaMoPeZzz commented 6 months ago

Summary

Argocd web provides many fields on the application details page, but some of these fields are not available in application metrics (_argocd_appinfo, _argocd_applabels, etc). These fields can easily be added to application metrics, similar to those exported.

Motivation

Additional fields in metrics can be useful for building overview dashboards in grafana.

Proposal

For the "Target revision" field there are already several proposals (#4115, #12259). The "URLs" and "Image" fields contain multiple values, so it is proposed to make separate metrics for them, for example argocd_app_image{default labels, image} and argocd_app_url{default labels, url}. Additional metrics will lead to an increase in resource consumption, so I suggest making them optional, like _argocd_applabels. I am ready to prepare PR if this proposal will be interesting to the community.

agaudreault commented 5 months ago

I think it is a good idea if they can be optional. You should update your proposal to evaluate different possible configurations and their pros and cons. 3 places that I see could contain configurations: global configuration, configuration in AppProject, configuration in Application resource.

wouter2397 commented 5 months ago

I'm very interested in this. We now have 2 usecases which we want to monitor in alerting and dashboards:

  1. Monitor if auto-sync is enabled for an application.
  2. Monitor which target revision is configured

Our view is that both use cases can be best monitored by extending the metrics. Very keen to see if this seems reasonable.