Skip to content

Latest commit

 

History

History

argocd

Agent Check: Argo CD

Overview

This check monitors Argo CD through the Datadog Agent.

Setup

Installation

The Argo CD check is included in the Datadog Agent package. No additional installation is needed on your server.

Note: This check requires Agent v7.42.0+.

Configuration

Argo CD exposes Prometheus-formatted metrics on three of their components:

  • Application Controller
  • API Server
  • Repo Server

The Datadog Agent can collect the exposed metrics using this integration. Follow the instructions below to configure data collection from any or all of the components.

Note: This check uses OpenMetrics for metric collection, which requires Python 3.

Containerized

Metric collection

Ensure that the Prometheus-formatted metrics are exposed in your Argo CD cluster. This is enabled by default if using Argo CD's default manifests. For the Agent to gather all metrics, each of the three aforementioned components needs to be annotated. For more information about annotations, see the Autodiscovery Integration Templates for guidance. Additional configuration options are available by reviewing the sample argocd.d/conf.yaml.

There are use cases where Argo CD Applications contain labels that need to be exposed as Prometheus metrics. These labels are available using the argocd_app_labels metric, which is disabled on the Application Controller by default. Refer to the ArgoCD Documentation for instructions on how to enable it.

Example configurations:

Application Controller:

apiVersion: v1
kind: Pod
# (...)
metadata:
  name: '<POD_NAME>'
  annotations:
    ad.datadoghq.com/argocd-application-controller.checks: |
      {
        "argocd": {
          "init_config": {},
          "instances": [
            {
              "app_controller_endpoint": "http://%%host%%:8082/metrics"
            }
          ]
        }
      }
    # (...)
spec:
  containers:
    - name: 'argocd-application-controller'
# (...)

API Server:

apiVersion: v1
kind: Pod
# (...)
metadata:
  name: '<POD_NAME>'
  annotations:
    ad.datadoghq.com/argocd-server.checks: |
      {
        "argocd": {
          "init_config": {},
          "instances": [
            {
              "api_server_endpoint": "http://%%host%%:8083/metrics"
            }
          ]
        }
      }
    # (...)
spec:
  containers:
    - name: 'argocd-server'
# (...)

Repo Server:

apiVersion: v1
kind: Pod
# (...)
metadata:
  name: '<POD_NAME>'
  annotations:
    ad.datadoghq.com/argocd-repo-server.checks: |
      {
        "argocd": {
          "init_config": {},
          "instances": [
            {
              "repo_server_endpoint": "http://%%host%%:8084/metrics"
            }
          ]
        }
      }
    # (...)
spec:
  containers:
    - name: 'argocd-repo-server'
# (...)

Note: For the full list of supported endpoints, see the conf.yaml example file.

Troubleshooting

Clashing Tag Names: The Argo CD integration attaches a name tag derived from the application name OpenMetrics label when available. This could sometimes lead to querying issues if a name tag is already attached to a host, as seen in the example name: host_a, app_a. To prevent any unwanted behavior when querying, it is advisable to remap the name label to something more unique, such as argocd_app_name if the host happens to already have a name tag. Below is an example configuration:

Application Controller:

apiVersion: v1
kind: Pod
# (...)
metadata:
  name: '<POD_NAME>'
  annotations:
    ad.datadoghq.com/argocd-application-controller.checks: |
      {
        "argocd": {
          "init_config": {},
          "instances": [
            {
              "app_controller_endpoint": "http://%%host%%:8082/metrics",
              "rename_labels": {
                "name": "argocd_app_name"
              }
            }
          ]
        }
      }
    # (...)
spec:
  containers:
    - name: 'argocd-application-controller'
# (...)
Log collection

Available for Agent versions >6.0

Argo CD logs can be collected from the different Argo CD pods through Kubernetes. Collecting logs is disabled by default in the Datadog Agent. To enable it, see Kubernetes Log Collection.

See the Autodiscovery Integration Templates for guidance on applying the parameters below.

Parameter Value
<LOG_CONFIG> {"source": "argocd", "service": "<SERVICE_NAME>"}

Validation

Run the Agent's status subcommand and look for argocd under the Checks section.

Data Collected

Metrics

See metadata.csv for a list of metrics provided by this integration.

Events

The Argo CD integration does not include any events.

Service Checks

See service_checks.json for a list of service checks provided by this integration.

Troubleshooting

Need help? Contact Datadog support.

Further Reading

Additional helpful documentation, links, and articles: