• 3 min read

Monitor ArgoCD applications

This post shows how to enable OpenTelemetry metrics for ArgoCD to gain deeper insights into your ArgoCD environments.

ArgoCD is an open-source tool that enables continuous delivery and deployment of applications to Kubernetes clusters via GitOps. With GitOps, the desired state of the application is defined in Git, and ArgoCD continuously monitors the Git repository for changes. When a change is detected, ArgoCD automatically updates the Kubernetes resources to match the desired state defined in Git.

ArgoCD has become very popular over the past six years and has grown a large community of supporters. A similar tool to ArgoCD, and the next most popular GitOps tool out there, is fluxcd:

The count of GitHub stars over time for the ArgoCD and Flux repositories. Flux trails ArgoCD and has a smaller growth rate.

How ArgoCD works

ArgoCD consists of three main components:

  • The API Server exposes the API for the web UI and CLI, manages application deployments, and handles authentication.
  • The Repository Server caches Git repositories locally and generates Kubernetes manifests.
  • The Application Controller continuously monitors running applications and compares their live state with the desired state in Git.

The workflow of ArgoCD is as follows. Developers push changes to a Git repository containing Kubernetes manifests, which describe what the infrastructure should look like.

Every time the repository server detects changes via webhooks or polling, clones the updated Git repo and generates the desired state manifest.

Then the Application Controller compares the desired state with the current cluster state. If differences are detected, Argo CD applies the necessary changes to the cluster.

How Dash0 uses ArgoCD

One ArgoCD installation can manage multiple Kubernetes clusters, at Dash0 we decided against it out of concerns of scalability, security and resilience. When we provision a new K8s cluster we automatically install an isolated ArgoCD instance, which handles installing all other required applications in the cluster.

But how do we monitor this critical component? With Dash0 itself of course, scraping the ArgoCD metrics using an OpenTelemetry collector:

yaml
012345678910111213141516
# Full config: https://github.com/argoproj/argo-helm/blob/main/charts/argo-cd/values.yaml
global:
# -- Add Prometheus scrape annotations to all metrics services. This can be used as an alternative to the ServiceMonitors.
addPrometheusAnnotations: true
## Controller
controller:
# -- Argo CD server log format: Either `text` or `json`
logFormat: json
## Application controller metrics configuration
metrics:
# -- Deploy metrics service
enabled: true
...

With this data, we create dashboards that show us the health and synchronization status of all applications across all ArgoCD instances:

Above is a sample dashboard based on the ArgoCD metrics of 2 ArgoCD instances running in two Kubernetes clusters. It shows that auto sync is enabled for all applications, the version of the ArgoCD instances, if there are degraded applications and if there are failed syncs.

You can have this dashboard too: it comes with the Dash0 Integrations hub, so you can get started quickly monitoring your own ArgoCD and adjust the dashboard to your needs.

Ready to experience observability without boundaries? Get started with Dash0 today!