> ## Documentation Index
> Fetch the complete documentation index at: https://docs.weaveos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Argo CD

> Track Argo CD application syncs and deployments

Connect Argo CD to track GitOps deployments, deployment frequency, reliability, and DORA metrics. You can connect with API polling for history and automatic discovery, or with push-based webhooks when your Argo CD instance should not be reachable from the internet.

## Setup

<Steps>
  <Step title="Create a read-only Argo CD token">
    Create or choose a service account in Argo CD with read access to applications. Generate a token for that account and keep it somewhere secure. Weave only needs read access for API polling.
  </Step>

  <Step title="Connect Argo CD in Weave">
    In Weave, go to the **Data** page and click the **Argo CD** tile. Choose one of the setup options:

    * **API polling** — Weave periodically reads application status from the Argo CD REST API. This supports application discovery and historical syncs. Your Argo CD API must be reachable by Weave.
    * **Push-based webhook** — Argo CD Notifications sends deployment events to Weave. This does not require inbound access to your Argo CD instance.
  </Step>

  <Step title="Configure applications">
    Weave discovers Argo CD applications and predicts which ones represent production deployments. Review the list, enable the applications you want to track, and adjust production deployment settings as needed.
  </Step>

  <Step title="Verify data">
    API polling starts after setup and runs automatically. Webhook events appear as Argo CD Notifications deliver them.
  </Step>
</Steps>

You can connect multiple Argo CD instances if your organization uses more than one.

## What's tracked

* Application sync executions
* Sync phase and result
* Deployment timing
* Git revision and repository URL
* Trigger type when it is available from Argo CD operation state
* Production deployment classification through Weave pipeline configuration

## DORA metrics enabled

Argo CD enables these deployment metrics:

* **[Deployment frequency](/metrics/ci-deploy-frequency)** — How often you deploy to production
* **[Deploy success rate](/metrics/ci-deploy-success-rate)** — Percentage of successful deployments
* **[MTTR](/metrics/ci-deploy-mttr)** — Mean time to recovery from failed deployments
* **[Deploy lead time](/metrics/pr-deploy-lead-time)** — Time from PR merge to production

## How it works

### API polling

Weave polls the Argo CD API to discover applications and read sync state. Use this option when Weave can reach your Argo CD instance over HTTPS and you want automatic discovery.

The token should allow reading applications. Weave does not require permission to modify applications, sync applications, or read Kubernetes secrets.

### Webhook setup

Webhook setup uses Argo CD Notifications. In Weave, connect Argo CD with the webhook option or generate a webhook secret from an existing Argo CD instance. Then configure Argo CD Notifications to send a POST request to:

```text theme={null}
https://app.workweave.ai/api/argocd/webhook
```

Include this header:

```text theme={null}
Authorization: Bearer <your-webhook-secret>
```

The webhook payload should include the application name, sync revision, repository URL, phase, and sync start/finish timestamps. Weave also accepts Argo CD Notifications payloads that embed the application object as `app`.

Example Argo CD Notifications service:

```yaml theme={null}
service.webhook.weave: |
  url: https://app.workweave.ai/api/argocd/webhook
  headers:
  - name: Authorization
    value: Bearer $weave-webhook-secret
```

Example template:

```yaml theme={null}
template.weave-app-sync: |
  webhook:
    weave:
      method: POST
      body: |
        {
          "app_name": "{{.app.metadata.name}}",
          "phase": "{{.app.status.operationState.phase}}",
          "revision": "{{.app.status.sync.revision}}",
          "repo_url": "{{(index .app.spec.sources 0).repoURL}}",
          "started_at": "{{.app.status.operationState.startedAt}}",
          "completed_at": "{{.app.status.operationState.finishedAt}}"
        }
```

Store the webhook secret in an Argo CD secret and reference it from the notification configuration. Keep the secret out of Git if your Argo CD Notifications config is stored in a repository.

## Data synced

Weave tracks deployment metadata:

* Application names
* Sync status and timestamps
* Git repository URLs
* Git revisions

**We never access:**

* Kubernetes secrets
* Application manifests
* Container images or artifacts
* Cluster credentials

## Troubleshooting

<AccordionGroup>
  <Accordion icon="plug" title="Connection failing">
    Confirm that the Argo CD URL is reachable from Weave, the token is valid, and the token has read access to applications.
  </Accordion>

  <Accordion icon="magnifying-glass" title="Applications not appearing">
    Check that the service account can list applications and that the applications are visible in the connected Argo CD instance.
  </Accordion>

  <Accordion icon="webhook" title="Webhooks not working">
    Verify the webhook secret, the `Authorization` header, and the Argo CD Notifications trigger/template. The repository URL and revision must be included so Weave can link deployments to pull requests.
  </Accordion>

  <Accordion icon="server" title="Deployments not detected">
    Open the Argo CD configuration page in Weave and confirm the relevant applications are enabled and marked as production deployments.
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.