argoproj / argo-cd

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

metrics: Add "server_name" to Application Controller metrics #10112

Open rodrigo14miguel opened 2 years ago

rodrigo14miguel commented 2 years ago

Summary

What change you think needs making: Add "server_name" label to the application controller metrics.

Motivation

Please give examples of your use case, e.g. when would you use this: Application controller metrics, like "argocd_cluster_api_resource_objects", have a label "server". This label's content is the api server url (k8s cluster managed by argocd) for that metrics. In some cases, this url is not very useful for dashboarding, in my case: https://K8S-API-IP:6443. I would like to use the cluster name instead of the cluster url for grafana dashboards.

Proposal

How do you think this should be implemented? Adding a label like "server_name" with the corresponding cluster name for the "server" url.

lukepatrick commented 1 year ago

want to bump this, also interested in the idea. If metrics could also include dest server name, would be much nicer for queries.

e.g.

# TYPE argocd_app_reconcile histogram
argocd_app_reconcile_bucket{dest_server="https://1234abcd.gr7.us-east-1.eks.amazonaws.com",namespace="argo",le="0.25"} 302013
argocd_app_reconcile_bucket{dest_server="https://1234abcd.gr7.us-east-1.eks.amazonaws.com",namespace="argo",le="0.5"} 1.248684e+06