---
title: Datadog
summary: null
url: https://www.fastly.com/documentation/guides/next-gen-waf/integrations/datadog
---

Our Datadog event integration (alert) creates an event when certain Next-Gen WAF activity occurs.

> **HINT:** 
>
> Want to set up alerting for your CDN or Compute service? Check out our [Observability](/guides/observability/alerts/about-alerts/) guides.
>
>
>

## Setting up Datadog integrations (alerts)

To set up a Datadog integration (alert), [create a Datadog API key](https://www.fastly.com/documentation/guides/next-gen-waf/integrations/datadog#creating-datadog-api-keys) and then [add the integration](https://www.fastly.com/documentation/guides/next-gen-waf/integrations/datadog#setting-up-the-integration) (alert).

### Creating Datadog API keys

Before you can set up the Datadog integration (alert), you need to create a Datadog API key:

1. Log in to [Datadog](https://app.datadoghq.com/account/settings#api).
2. Click **Integrations** in the navigation bar on the left.
3. Click **APIs**.
4. Click **Create API Key**.
5. Create a new API key by following the steps.
6. Copy the provided **API Key**.

### Adding Datadog integrations (alerts)

Once you've created a Datadog API key, you can use that API key to set up the Datadog integration (alert):

### Next Gen Waf Control Panel

1.   Log in to the [Next-Gen WAF control panel](https://dashboard.signalsciences.net).

2.   From the **Sites** menu, select a site if you have more than one site.

3. From the **Manage** menu, select **Site Integrations**.
4. Click **Add site integration**.
5. Select the **Datadog Alert** integration.
6. In the **API Key** field, enter the **API Key** created in Datadog.
7. From the **Site** menu, select your preferred Datadog endpoint.
8.   Select if you want to be alerted regarding **All activity** or **Specific activity**. If you selected **Specific activity**, then in the **Activity** menu choose the activity types that you want the integration to create alerts for.

9. Click **Create site integration**.

### Fastly Control Panel

1.   Log in to the [Fastly control panel](https://manage.fastly.com).

2.   Go to **Security** > **Next-Gen WAF** > [**Workspaces**](https://manage.fastly.com/security/ngwaf/workspaces).

3.   Click the gear <span class="inline-icons"><img src="/img/icons/gear.png" alt="Gear icon" /></span> next to the workspace that you want to modify.

4. Click **Alerts** and then **Add alert**.
5. Fill out the **Add alert** form as follows:
   - From the **Integration type** menu, select **Datadog**.
   - In the **API Key** field, enter the **API Key** created in Datadog.
   - From the **Site** menu, select your preferred Datadog endpoint.
   - In the **Select activities** menu, leave **Flagged IPs** checked.
6. Click **Add workspace alert**.

## Activity types

> **IMPORTANT:** This section only applies to Next-Gen WAF customers with access to the [Next-Gen WAF control panel](https://dashboard.signalsciences.net).

When setting up a Datadog integration (alert) in the Next-Gen WAF control panel, you can select from the following activity types:

| Activity type | Description                  |
| ------------- | ---------------------------- |
| `flag`        | An IP address was flagged    |
| `agentAlert`  | An agent alert was triggered |

## Using the default dashboard in Datadog

Datadog has a [default dashboard](https://docs.datadoghq.com/integrations/sigsci/) populated with StatsD metrics from the Next-Gen WAF agent. To use this functionality:

1. Find and install the Signal Sciences integration tile in Datadog integrations tab.

2. Confirm that the Datadog agent is configured to listen for [StatsD events](https://docs.datadoghq.com/developers/dogstatsd/).

3. Configure the Next-Gen WAF agent to use `dogstatsd`:

   - Add the following line to each agent's agent.config file:

     ```
     statsd-type = "dogstatsd"
     ```

   - When this is done the agent's `statsd` client will have tagging enabled and metrics such as `sigsci.agent.signal.` will be sent as `sigsci.agent.signal` and tagged with `signal_type:` (e.g., `sigsci.agent.signal.http404` => `sigsci.agent.signal tag signal_type:http404`).

   - If using Kubernetes to run the Datadog agent, make sure to enable DogStatsD non local traffic as described in the [Kubernetes DogStatsD documentation](https://docs.datadoghq.com/agent/kubernetes/dogstatsd/).

4. Configure the Next-Gen WAF agent to send metrics to the Datadog agent by adding the following line to each agent's agent.config file:

   ```term copy
   $ statsd-address=":"
   ```

5. Verify that the **Signal Sciences - Overview** dashboard is created and starting to capture metrics.

## Related content

- [Using an API with the Next-Gen WAF](https://www.fastly.com/documentation/guides/next-gen-waf/developer/using-an-api-with-the-next-gen-waf)
