> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/logs/integrations/providers/datadog.md).

# Datadog

Connect Datadog to Logs — the integration can be saved, but Norbix cannot send logs to Datadog yet.

Datadog is a monitoring service with log search, dashboards and alerts. Norbix would send your project's log entries to Datadog's log intake for your site.

{% hint style="warning" %}
Cloud has no working Datadog delivery yet. The **Datadog** card and form are there and **Save** works, but every test fails with *Log delivery for the 'DataDog' provider is configured but not yet supported by this version.* — and an integration with a failed test receives no entries. To keep your logs today, use [Norbix Logging](/codemash/cloud/logs/integrations/providers/norbix-logging.md). The settings below can already be saved with the SDK, the CLI or the API.
{% endhint %}

## Get your credentials

1. Sign in to Datadog and note your **site** — the address you sign in at, for example `datadoghq.com` (US1) or `datadoghq.eu` (EU). The list of sites is in [Datadog sites](https://docs.datadoghq.com/getting_started/site/).
2. Open **Organization Settings → API Keys** and create or copy an **API key** (not an application key). See [API and application keys](https://docs.datadoghq.com/account_management/api-app-keys/).
3. Choose the **service** and **environment** tags your logs should carry, for example `bookshop-api` and `production`.

## Connect it in Cloud

**Where:** Logs → Integrations → **Add New Integration** → Datadog · `/projects/<project>/logging/integrations/new/datadog`

| Field            | Required | What it does                                     | Example                |
| ---------------- | -------- | ------------------------------------------------ | ---------------------- |
| Datadog Site     | yes      | Your Datadog site.                               | `datadoghq.eu`         |
| Service Name     | yes      | The `service` tag on every entry.                | `bookshop-api`         |
| Environment      | yes      | The `env` tag on every entry.                    | `production`           |
| API Key          | yes      | Secret; encrypted on save and never shown again. | `your-datadog-api-key` |
| Integration Name | yes      | The name in your integrations list.              | `Datadog EU`           |

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-6358279fdfa1dd353b6a72c55ff15470e8a39f4a%2Fdatadog-form-1.png?alt=media" alt="New Datadog Integration form filled: Datadog Site datadoghq.eu, Service Name bookshop-api, Environment production, API Key hidden, Integration Name Datadog EU"><figcaption><p>The filled form (the API key is a placeholder).</p></figcaption></figure>

After **Save** and **Test integration**, the integration page shows **ENABLED** and **TEST FAILED**:

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-98a1196e1aba7b4206177fbdf8f948624df32ae7%2Fdatadog-saved-2.png?alt=media" alt="Editing Datadog integration with the badges ENABLED and TEST FAILED and its int_ id"><figcaption><p>After Save: saved, but the test fails.</p></figcaption></figure>

## Test and set as default

**Test integration** runs one check, **WriteLog**, and it fails today for every Datadog integration — with a real key or a made-up one, because Norbix has no Datadog sender yet. See [Test an integration](/codemash/cloud/logs/integrations/test.md). Logging has no default integration ([Default integration](/codemash/cloud/logs/integrations/set-default.md)).

## Common errors

| Message                                                                                        | Cause                                                                     | Fix                                                                                  |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| Log delivery for the 'DataDog' provider is configured but not yet supported by this version. … | Every Datadog test today.                                                 | Use [Norbix Logging](/codemash/cloud/logs/integrations/providers/norbix-logging.md). |
| Required                                                                                       | An empty field on the form. On edit, the **API Key** must be typed again. | Fill every field.                                                                    |
| Property Site is required (also ServiceName, Environment, ApiKey)                              | A field missing in a request from code.                                   | Send all four fields.                                                                |

## Do it from code

```ts
const { id } = await norbix.hub.logs.saveLoggingIntegration({
  integration: {
    provider: 'DataDog',
    integrationName: 'Datadog EU',
    isEnabled: true,
    site: 'datadoghq.eu',
    serviceName: 'bookshop-api',
    environment: 'production',
    apiKey: 'your-datadog-api-key',
  } as any, // the TS type knows only the shared fields
});
```

```sh
norbix hub logs logging integration save --integration '{"provider":"DataDog","integrationName":"Datadog EU","isEnabled":true,"site":"datadoghq.eu","serviceName":"bookshop-api","environment":"production","apiKey":"your-datadog-api-key"}'
```

The provider is written `DataDog` in requests. The client setup is on the [Logs page](/codemash/cloud/logs.md#use-it-from-code). API: [Save Logging Integration](/codemash/api-reference/logs/integrations/save-logging-integration.md)
