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

# Deployment Tracking

> Send deployment events to ewake from any CI/CD pipeline to enable deployment-correlated incident analysis.

<Info>
  **What you'll get:** ewake correlates production issues with deployment events in real time. When an alert fires, it automatically checks whether a recent deployment on the affected service could be the cause.
</Info>

***

## Prerequisites

You need an ewake API key to authenticate deployment events.

Go to your ewake instance → **Settings** → **API Keys** → create a key scoped to deployment tracking. Store it as a secret in your CI/CD environment (e.g. `ewake_API_KEY`).

***

## How it works

Send a deployment event to ewake each time you deploy to production. Ewake stores these events in your environment's knowledge map and uses them as context during alert investigations.

<Note>
  The `artifactName` field must match the service name as it appears in your observability stack (Datadog, Grafana, etc.) for correlation to work.
</Note>

***

## Option 1, GitHub Actions

The ewake GitHub Action is available on the [GitHub Marketplace](https://github.com/marketplace/actions/report-deployment). Add \~5 lines to any existing workflow, no changes to your deployment logic required.

```yaml theme={null}
- name: Report deployment to ewake
  uses: ewake-ai/report-deployment-action@v1
  with:
    api-key: ${{ secrets.ewake_API_KEY }}
    artifact-name: "my-service"
    version: ${{ github.sha }}
    message: "Deploy ${{ github.ref_name }} to production"
    # repository: ${{ github.repository }}          # optional
    # commit-sha: ${{ github.sha }}                  # optional
    # labels: '{"env": "production"}'               # optional: custom metadata
    # api-url: "https://your-ewake-instance"        # optional: self-hosted override
```

| Parameter       | Required | Description                                             |
| --------------- | -------- | ------------------------------------------------------- |
| `api-key`       | ✅        | Your ewake API key                                      |
| `artifact-name` | ✅        | Must match the service name in your observability stack |
| `version`       | —        | Semver, image tag, or short SHA                         |
| `message`       | —        | Free-text deployment description                        |
| `repository`    | —        | Repository identifier (e.g. `my-org/my-service`)        |
| `commit-sha`    | —        | Full or short commit SHA                                |
| `labels`        | —        | JSON object with custom metadata                        |
| `api-url`       | —        | Override for self-hosted ewake instances                |

<Note>
  Non-blocking by design, if ewake is unreachable, your deployment continues unaffected.
</Note>

***

## Option 2, Direct API call

```bash theme={null}
curl -X POST https://api.ewake.ai/api/v1/events/deployment \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "artifactName": "my-service",
    "repository": "my-org/my-service",
    "commitSha": "abc123",
    "version": "1.2.3",
    "message": "Deployed by CI",
    "timestamp": "2026-04-14T12:00:00Z",
    "source": "ci",
    "labels": {"env": "production"}
  }'
```

A `202 Accepted` response confirms the event was received.

| Field          | Required | Description                                                |
| -------------- | -------- | ---------------------------------------------------------- |
| `artifactName` | ✅        | Must match the service name in your observability stack    |
| `repository`   | —        | Repository identifier (e.g. `my-org/my-service`)           |
| `commitSha`    | —        | Full or short commit SHA                                   |
| `version`      | —        | Semver, image tag, or short SHA                            |
| `message`      | —        | Free-text deployment description                           |
| `timestamp`    | —        | ISO 8601 datetime, defaults to time of receipt if omitted  |
| `source`       | —        | Deployment source identifier (e.g. `ci`, `github-actions`) |
| `labels`       | —        | JSON object with custom metadata                           |

***

## Troubleshooting

| Error              | Cause                                               |
| ------------------ | --------------------------------------------------- |
| `401 Unauthorized` | Invalid or missing API key                          |
| `400 Bad Request`  | `artifactName` field missing or malformed           |
| Timeout            | Check proxy or firewall settings for outbound HTTPS |
