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

# Datadog

How Reflag integrates with Datadog to catch regressions on new feature releases

With the Datadog integration, you can enrich your RUM data with feature flag data. This will enable you to catch regressions on new feature releases.

### Get available features from Reflag

In this example, we're using the [React SDK](/supported-languages/browser-sdk.md):

```javascript
import { datadogRum } from "@datadog/browser-rum";
import { useClient } from "@reflag/react-sdk";

// Component to enhnance datadog RUM with flag checks
function DatadogIntegration() {
  const client = useClient();
  useEffect(() => {
    return client?.on("check", (check) => {
      datadogRum.addFeatureFlagEvaluation(check.key, check.value);
    });
  }, [client]);
  return null;
}
```

Add the component inside the ReflagProvider:

```tsx
function App() {
  return (
    <ReflagProvider>
      <DatadogIntegration /> // Add the component inside the <ReflagProvider>
      {children}
    </ReflagProvider>
  )
}
```

Which will look like this on Datadog:

<figure><img src="https://content.gitbook.com/content/pgXAy2Cgsm5pON9oJ06m/blobs/92LTrrz3cX42jwqujHvO/feature-flag-list-rum-event.d9c1c876a34458edc70d1317efaec05b.png.avif" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/pgXAy2Cgsm5pON9oJ06m/blobs/jIITHA8EncJ4fmTHlM0j/rum-explorer-session-feature-flag-search.435802460fd607608ad5155f029da57b.png.avif" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/pgXAy2Cgsm5pON9oJ06m/blobs/Knnbwrurxzpqi0CzqKyE/rum-explorer-error-feature-flag-search.7b9f6c046db1de1c71d279c139f1508a.png.avif" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.reflag.com/integrations/datadog.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
