# Datadog Alerts Integration

Datadog Alerts Integration enables you to receive PerfectScale Alerts directly into your Datadog dashboard, ensuring you stay informed about any resilience risks identified in your Kubernetes environment, and helping you prioritize tasks to eliminate the issues before they impact performance and user experience.

Datadog Alerts Integration could be enabled in a few simple steps:

1. [Create an API Key](#how-to-create-api-kye-in-datadog) in Datadog.
2. Configure [Datadog Alerts Profile](#how-to-create-datadog-alerts-profile).
3. [Apply the profile](#how-to-apply-datadog-alerts-profile) to the desired cluster(s).

## :tools: **How to create API Kye in Datadog**&#x20;

1. Log in to your Datadog profile.

2. Hover over your account icon and click API Keys<br>

   <figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2Fs236jLEdvFzO6yyuSu3j%2FGroup%205106%20(2).png?alt=media&#x26;token=84ae9061-6b38-48a6-92f9-a5b557d56412" alt="" width="375"><figcaption><p>Datadog API key</p></figcaption></figure>

3. Click **`New Key`** button, name your key, and click **`Create Key`**.<br>

   <figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2FsV9ac3nj83rLcRhHFSFA%2FGroup%205109.png?alt=media&#x26;token=468c178f-49fb-440d-bc80-ee3a5277bb03" alt=""><figcaption><p>New key1</p></figcaption></figure>

4. Copy the **API Key.** You will need it for the [Datadog Alerts Profile configuration](#datadog-alerts-profile-configuration).<br>

   <figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2FfPaAvRjrviyM6XPscwfg%2FGroup%205111.png?alt=media&#x26;token=bde5682d-120c-4713-bd69-98fa60573753" alt="" width="375"><figcaption><p>New key2</p></figcaption></figure>

## Configuring Datado integration with the profile <a href="#configuring-datadog-integration-with-the-profile" id="configuring-datadog-integration-with-the-profile"></a>

### :tools: **How to create Datadog Alerts Profile**

There are two options for creating a Profile: [from the Settings](#from-the-settings-tab) tab or directly [from the Overview](#from-the-overview-tab).

#### From the **Settings** tab

Go to the **`Settings`** tab on the left panel -> select **`Integrations`** -> click the **`+Add Integration`** button and select **`Datadog`** from the drop-down -> insert the required data.

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2FjJtdBa4RCY1Zk2OLRRCo%2Fdatadog_create_settings.gif?alt=media&#x26;token=6a885770-4a12-4798-9598-410cd055be71" alt=""><figcaption><p>Datadog alerts profile from settings</p></figcaption></figure>

#### From the **Overview** tab

Go to the **`Overview`** tab on the left panel -> find the cluster to which you want to apply the **`Profile`** and click **`gear`** button -> go to **`Customizations`** -> find **`Integrations`** and click the **`Monitoring`** drop-down list -> click the **`Add New Profile`** button -> insert the required data.

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2F07wiDzQthDkmOsGUp5oq%2Fdatadog_create.gif?alt=media&#x26;token=10977557-715b-447d-90c4-10dc5e23f3df" alt=""><figcaption><p>Datadog alerts profile from overview</p></figcaption></figure>

#### Datadog alerts Profile Configuration

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2FdWZIiEiycXQFWR9gKr3F%2FGroup%205116.png?alt=media&#x26;token=6e8c5be1-4419-4ef6-a2a8-3ba54cda3107" alt="" width="563"><figcaption><p>Datadog alerts profile configuration</p></figcaption></figure>

1. Name the Profile
2. `datadog_api_key` - Datadog API Key. See the details [here](#how-to-create-api-kye-in-datadog).\
   \
   `datadog_site_region` - specifies the Datadog regional domain where your data is sent and managed (example: datadoghq.com).

The available datadog\_site\_region:

| Code    | Domain            |
| ------- | ----------------- |
| US1     | datadoghq.com     |
| US3     | us3.datadoghq.com |
| US5     | datadoghq.com     |
| EU      | datadoghq.eu      |
| AP1     | ap1.datadoghq.com |
| US1-FED | ddog-gov.com      |

3. Use **`Set as default`** checkbox to automatically assign the profile to the clusters.\
   \
   :bulb: **NOTE**: The manually assigned profile takes priority over the default one.

### :tools: **How to apply** **Datadog Alerts Profile**

#### Apply to a single cluster

To apply **`Datadog Alerts Profile`** to the cluster, go to the **`Overview`** tab on the left panel -> find the cluster to which you want to apply the **`Datadog Alerts Profile`** and click **`gear`** button -> go to **`Customizations`** -> select the needed profile in the **`Monitoring`** drop-down list.&#x20;

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2F3lhDixjXehdvssX1shjl%2Fdatadog_apply_single.gif?alt=media&#x26;token=0e3041ad-7574-46c7-be35-6f5c61c31492" alt=""><figcaption><p>Applying Datadog alerts profile to a single cluster</p></figcaption></figure>

#### Apply to multiple clusters

To apply the profile to **multiple clusters** from a single view, use the **`Manage Assignments`** feature.&#x20;

Go to the **`Settings`** tab on the left panel -> select the **`Integrations`** -> click the **`Manage Assignments`** button -> go to **`Monitoring`** section and apply the profiles for the needed clusters -> click the **`Save Changes`** button.

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2FZv6MP5sAsTIhTkQwDWTT%2Fdatadog_apply_multiple.gif?alt=media&#x26;token=569e9115-7a1c-485e-986e-ad2e0e95d25c" alt=""><figcaption><p>Applying Datadog alerts profile to multiple clusters</p></figcaption></figure>

### **How to uninstall Datadog Alerts Integration**

In order to stop submitting Alerts to Datadog, the profile should be unassigned from the cluster.

Go to the **`Settings`** tab on the left panel -> select the **`Integrations`** -> click the **`Manage Assignments`** button -> go to **`Monitoring`** section and select **`None`** for the needed clusters -> click the **`Save Changes`** button.

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2Fv7YliOLxBIs9zeVV9Ejf%2Fdatadog_uninstall.gif?alt=media&#x26;token=a31bc687-ace4-4497-9018-cff9ad67b03b" alt=""><figcaption><p>Uninstall Datadog alerts integration</p></figcaption></figure>

## Configuring Datadog integration with CRD

To enable Datadog alerts using a Custom Resource Definition (CRD), you’ll need to define and apply a Custom Resource (CR) with the required parameters. This approach allows you to manage Datadog alerting directly through Kubernetes manifests.&#x20;

{% hint style="warning" %}
The Custom Resource (CR) must be created in the `perfectscale` namespace.
{% endhint %}

### Setup instructions

1. Log in to your Datadog account.
2. Navigate to Organization Settings > API Keys.
3. Create or copy an API key.
4. Copy the API key (you will need it for the **Datadog API Key secret** in the next steps).

Apply the **Datadog API Key secret** first:

```yaml
apiVersion: v1
kind: Secret
metadata:
  name: datadog-credentials
  namespace: perfectscale
type: Opaque
stringData:
  api-key: "your-datadog-api-key-here"
```

{% hint style="info" %}
Ensure that the secret is created in the same namespace as the exporter -  `perfectscale`.
{% endhint %}

Configure the CR:

```yaml
apiVersion: perfectscale.io/v1
kind: ClusterSettings
metadata:
  name: cluster-settings-main
  namespace: perfectscale
spec:
  profiles:
    integrations:
      - type: datadog
        name: production-monitoring
        assigned: true
        value:
          datadog_api_key_from:
            secretKeyRef:
              name: datadog-credentials
              key: api-key
          datadog_site_region: "datadoghq.com"
```

⚙️ **CR parameters:**

<table><thead><tr><th width="251.94921875">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>datadog_api_key_from</code></strong></td><td>A secret that contains a Datadog API Key. Learn more how to create it <a href="#how-to-create-api-kye-in-datadog">here.</a></td></tr><tr><td><strong><code>datadog_site_region</code></strong></td><td>Specifies the Datadog regional domain where your data is sent and managed. </td></tr></tbody></table>

{% hint style="info" %}
Available datadog\_site\_region values:

* **US1**: datadoghq.com
* **US3**: us3.datadoghq.com
* **US5**: us5.datadoghq.com
* **EU**: datadoghq.eu
* **AP1**: ap1.datadoghq.com
* **US1-FED**: ddog-gov.com
  {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.perfectscale.io/customize-workflow/communication-and-messaging/datadog-alerts-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
