github.com/argoproj/argo-cd/v2@v2.10.9/docs/operator-manual/metrics.md (about)

     1  # Metrics
     2  
     3  Argo CD exposes different sets of Prometheus metrics per server.
     4  
     5  ## Application Controller Metrics
     6  Metrics about applications. Scraped at the `argocd-metrics:8082/metrics` endpoint.
     7  
     8  | Metric | Type | Description |
     9  |--------|:----:|-------------|
    10  | `argocd_app_info` | gauge | Information about Applications. It contains labels such as `sync_status` and `health_status` that reflect the application state in Argo CD. |
    11  | `argocd_app_k8s_request_total` | counter | Number of Kubernetes requests executed during application reconciliation |
    12  | `argocd_app_labels` | gauge | Argo Application labels converted to Prometheus labels. Disabled by default. See section below about how to enable it. |
    13  | `argocd_app_reconcile` | histogram | Application reconciliation performance. |
    14  | `argocd_app_sync_total` | counter | Counter for application sync history |
    15  | `argocd_cluster_api_resource_objects` | gauge | Number of k8s resource objects in the cache. |
    16  | `argocd_cluster_api_resources` | gauge | Number of monitored Kubernetes API resources. |
    17  | `argocd_cluster_cache_age_seconds` | gauge | Cluster cache age in seconds. |
    18  | `argocd_cluster_connection_status` | gauge | The k8s cluster current connection status. |
    19  | `argocd_cluster_events_total` | counter | Number of processes k8s resource events. |
    20  | `argocd_cluster_info` | gauge | Information about cluster. |
    21  | `argocd_kubectl_exec_pending` | gauge | Number of pending kubectl executions |
    22  | `argocd_kubectl_exec_total` | counter | Number of kubectl executions |
    23  | `argocd_redis_request_duration` | histogram | Redis requests duration. |
    24  | `argocd_redis_request_total` | counter | Number of redis requests executed during application reconciliation |
    25  
    26  If you use Argo CD with many application and project creation and deletion,
    27  the metrics page will keep in cache your application and project's history.
    28  If you are having issues because of a large number of metrics cardinality due
    29  to deleted resources, you can schedule a metrics reset to clean the
    30  history with an application controller flag. Example:
    31  `--metrics-cache-expiration="24h0m0s"`.
    32  
    33  ### Exposing Application labels as Prometheus metrics
    34  
    35  There are use-cases where Argo CD Applications contain labels that are desired to be exposed as Prometheus metrics.
    36  Some examples are:
    37  
    38  * Having the team name as a label to allow routing alerts to specific receivers
    39  * Creating dashboards broken down by business units
    40  
    41  As the Application labels are specific to each company, this feature is disabled by default. To enable it, add the
    42  `--metrics-application-labels` flag to the Argo CD application controller.
    43  
    44  The example below will expose the Argo CD Application labels `team-name` and `business-unit` to Prometheus:
    45  
    46      containers:
    47      - command:
    48        - argocd-application-controller
    49        - --metrics-application-labels
    50        - team-name
    51        - --metrics-application-labels
    52        - business-unit
    53  
    54  In this case, the metric would look like:
    55  
    56  ```
    57  # TYPE argocd_app_labels gauge
    58  argocd_app_labels{label_business_unit="bu-id-1",label_team_name="my-team",name="my-app-1",namespace="argocd",project="important-project"} 1
    59  argocd_app_labels{label_business_unit="bu-id-1",label_team_name="my-team",name="my-app-2",namespace="argocd",project="important-project"} 1
    60  argocd_app_labels{label_business_unit="bu-id-2",label_team_name="another-team",name="my-app-3",namespace="argocd",project="important-project"} 1
    61  ```
    62  
    63  ## API Server Metrics
    64  Metrics about API Server API request and response activity (request totals, response codes, etc...).
    65  Scraped at the `argocd-server-metrics:8083/metrics` endpoint.
    66  
    67  | Metric | Type | Description |
    68  |--------|:----:|-------------|
    69  | `argocd_redis_request_duration` | histogram | Redis requests duration. |
    70  | `argocd_redis_request_total` | counter | Number of Kubernetes requests executed during application reconciliation. |
    71  | `grpc_server_handled_total` | counter | Total number of RPCs completed on the server, regardless of success or failure. |
    72  | `grpc_server_msg_sent_total` | counter | Total number of gRPC stream messages sent by the server. |
    73  
    74  ## Repo Server Metrics
    75  Metrics about the Repo Server.
    76  Scraped at the `argocd-repo-server:8084/metrics` endpoint.
    77  
    78  | Metric | Type | Description |
    79  |--------|:----:|-------------|
    80  | `argocd_git_request_duration_seconds` | histogram | Git requests duration seconds. |
    81  | `argocd_git_request_total` | counter | Number of git requests performed by repo server |
    82  | `argocd_redis_request_duration_seconds` | histogram | Redis requests duration seconds. |
    83  | `argocd_redis_request_total` | counter | Number of Kubernetes requests executed during application reconciliation. |
    84  | `argocd_repo_pending_request_total` | gauge | Number of pending requests requiring repository lock |
    85  
    86  ## Prometheus Operator
    87  
    88  If using Prometheus Operator, the following ServiceMonitor example manifests can be used.
    89  Add a namespace where Argo CD is installed and change `metadata.labels.release` to the name of label selected by your Prometheus.
    90  
    91  ```yaml
    92  apiVersion: monitoring.coreos.com/v1
    93  kind: ServiceMonitor
    94  metadata:
    95    name: argocd-metrics
    96    labels:
    97      release: prometheus-operator
    98  spec:
    99    selector:
   100      matchLabels:
   101        app.kubernetes.io/name: argocd-metrics
   102    endpoints:
   103    - port: metrics
   104  ```
   105  
   106  ```yaml
   107  apiVersion: monitoring.coreos.com/v1
   108  kind: ServiceMonitor
   109  metadata:
   110    name: argocd-server-metrics
   111    labels:
   112      release: prometheus-operator
   113  spec:
   114    selector:
   115      matchLabels:
   116        app.kubernetes.io/name: argocd-server-metrics
   117    endpoints:
   118    - port: metrics
   119  ```
   120  
   121  ```yaml
   122  apiVersion: monitoring.coreos.com/v1
   123  kind: ServiceMonitor
   124  metadata:
   125    name: argocd-repo-server-metrics
   126    labels:
   127      release: prometheus-operator
   128  spec:
   129    selector:
   130      matchLabels:
   131        app.kubernetes.io/name: argocd-repo-server
   132    endpoints:
   133    - port: metrics
   134  ```
   135  
   136  ```yaml
   137  apiVersion: monitoring.coreos.com/v1
   138  kind: ServiceMonitor
   139  metadata:
   140    name: argocd-applicationset-controller-metrics
   141    labels:
   142      release: prometheus-operator
   143  spec:
   144    selector:
   145      matchLabels:
   146        app.kubernetes.io/name: argocd-applicationset-controller
   147    endpoints:
   148    - port: metrics
   149  ```
   150  
   151  ```yaml
   152  apiVersion: monitoring.coreos.com/v1
   153  kind: ServiceMonitor
   154  metadata:
   155    name: argocd-dex-server
   156    labels:
   157      release: prometheus-operator
   158  spec:
   159    selector:
   160      matchLabels:
   161        app.kubernetes.io/name: argocd-dex-server
   162    endpoints:
   163      - port: metrics
   164  ```
   165  
   166  ```yaml
   167  apiVersion: monitoring.coreos.com/v1
   168  kind: ServiceMonitor
   169  metadata:
   170    name: argocd-redis-haproxy-metrics
   171  spec:
   172    selector:
   173      matchLabels:
   174        app.kubernetes.io/name: argocd-redis-ha-haproxy
   175    endpoints:
   176    - port: http-exporter-port
   177  ```
   178  
   179  For notifications controller, you need to additionally add following: 
   180  
   181  ```yaml
   182  apiVersion: monitoring.coreos.com/v1
   183  kind: ServiceMonitor
   184  metadata:
   185    name: argocd-notifications-controller
   186    labels:
   187      release: prometheus-operator
   188  spec:
   189    selector:
   190      matchLabels:
   191        app.kubernetes.io/name: argocd-notifications-controller-metrics
   192    endpoints:
   193      - port: metrics
   194  ```
   195  
   196  
   197  ## Dashboards
   198  
   199  You can find an example Grafana dashboard [here](https://github.com/argoproj/argo-cd/blob/master/examples/dashboard.json) or check demo instance
   200  [dashboard](https://grafana.apps.argoproj.io).
   201  
   202  ![dashboard](../assets/dashboard.jpg)