# Datadog

This guide provides step-by-step instructions for integrating your Datadog account with slaOS. This integration allows slaOS to collect metrics, logs, and other data from your Datadog account to monitor your services effectively.

{% hint style="info" %}
The [app.rated.co](https://app.rated.co) interface guides you step-by-step, all the way through to a successful Datadog integration! &#x20;
{% endhint %}

## Prerequisites

* An active Datadog account with administrative access
* Your slaOS account credentials

## Integration Steps

### Step 1: Create a Datadog API Key

1. Log in to your Datadog account.
2. Navigate to Organization Settings > API Keys.
3. On "API Keys" page click on "New Key".
4. Give your API key a name (e.g., `slaOS Integration`).
5. Copy the generated API key and store it securely.

### Step 2: Create a Datadog Application Key

1. Still on the Organization Settings click on "Application Keys" and then "New Key".
2. Give your application key a name (e.g., `slaOS App Key`).
3. Under Scope, click "Edit" and add `events_read`. This alows slaOS to read event data from your Datadog account.
4. Copy the generated application key and store it securely.

### Step 3: Provide Integration Details

You'll need to provide the following information to slaOS:

1. Datadog site (e.g., `datadoghq.com` for US1, `datadoghq.eu` for EU, etc.)
2. API Key
3. Application Key

{% tabs %}
{% tab title="slaOS-managed" %}

1. During the onboarding process in the slaOS user interface, you'll be prompted to enter your Datadog secrets.
2. The slaOS system will automatically verify your credentials to ensure they have the necessary permissions.
3. Depending on your integration needs, slaOS will verify access to logs, metrics, or both.
   {% endtab %}

{% tab title="Self-hosted" %}
If you're using a self-hosted version of slaOS, you'll need to manually add your Datadog credentials to the configuration file:

1. Locate your slaOS configuration YAML file.
2. Add the following section to your YAML file, replacing the placeholder values with your actual Datadog credentials:

```yaml
datadog:
    site: datadoghq.com
    api_key: your_datadog_api_key
    app_key: your_datadog_app_key

```

{% hint style="info" %}
For more detailed information about Datadog configuration in self-hosted environments, refer to the [self-hosted page](/onboarding-your-data/self-hosting.md) in our documentation. Alternatively, you can find example templates in our [GitHub repository](https://github.com/rated-network/rated-log-indexer).
{% endhint %}
{% endtab %}
{% endtabs %}

### Step 4: Configure Log Parsing

To set up effective SLI queries, slaOS needs to understand which parts of your logs are most relevant to your service's performance metrics. Provide the following information:

1. Specific fields from your logs to use in SLI queries.
2. Data type of each field (e.g., string, integer, float, datetime).
3. The field that specifies the user (e.g., id, api\_key) that the log event belongs to.
4. Any necessary transformations for these fields.

## Frequently Asked Questions (FAQ)

### How do I rotate my Datadog API or application keys?

Generate new keys in your Datadog account settings and update them in your slaOS integration settings. Be sure to revoke the old keys after confirming the new ones work.

### What data does slaOS collect from my Datadog account?

slaOS collects event data as specified in your log parsing configuration. It does not collect or access any other data from your Datadog account.

### How often does slaOS collect data from Datadog?

slaOS collects data in near real-time, typically with a delay of a few minutes depending on Datadog's own latency.

### Can I limit the scope of data slaOS can access?

Yes! You can create a limited-scope API key in Datadog with only the necessary permissions. Consult the Datadog documentation for instructions on creating custom API keys:

{% embed url="<https://docs.datadoghq.com/account_management/api-app-keys/>" %}

***

For any additional questions or issues, please contact the slaOS support team on Slack.


---

# 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.rated.co/onboarding-your-data/integrations/datadog.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.
