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

# Datadog

<div align="left"><figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FFBciZ06NJgzBXRUlghjN%2Fdatadog.png?alt=media&amp;token=f335798f-c9a1-4aee-8d2c-6ae520a64194" alt=""><figcaption></figcaption></figure></div>

## Set up

### Navigate to the Integration settings view

1. Select an app in the top left corner from the Switcher
2. Navigate to **App Settings** by clicking the gear icon (⚙️) at the top of the Timeline sidebar
3. Click on **Integrations** in the sidebar

### **Connect Datadog**

1. Find the **Datadog** integration module under the **Observability & analytics** section
2. Click the **Connect** button
3. Enter your **API Key** and **Application Key Secrets.** You can find your API Key and Application Key Secrets by visiting **Organization Settings > Access** in Datadog. :link:[Datadog documentation: API and Application Keys](https://docs.datadoghq.com/account_management/api-app-keys/)

{% hint style="info" %}
It isn't strictly necessary to specify scopes when creating an Application Key, as it will inherit the scopes of the user or service account that is creating it.
{% endhint %}

### Configure the Datadog integration

1. Select the desired Datadog **Application** from the drop down list
2. Select **custom action type events** from your Datadog project to monitor from Runway. Additionally, you can specify event metrics to track metrics such as averages, medians, and percentiles.

Runway's Observability & Analytics integration with Datadog currently supports Custom metrics and RUM events:&#x20;

* Configuring Custom metrics:&#x20;

  <figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FTUl27U8WUCP7pswvZwxv%2Fimage.png?alt=media&amp;token=510d9350-1234-4e5a-9ceb-f8895c5be7e1" alt="" width="375"><figcaption></figcaption></figure>

  * **Metrics**: click **Add metric**, then enter the **Metric name** and choose its **Aggregation**: Average, Count, Sum, Minimum, Maximum, p50, p75, p90, p95 or p99. Percentiles only work on distribution metrics, like APM latency.
    * **Tag filter** (optional): narrows this one metric, using Datadog's tag syntax (e.g. `resource_name:/api/checkout`). It's combined with **Tag filters for all metrics**, the service filter and the version, so it can only narrow the data further. Use `AND` instead of commas, and `NOT` instead of `-` to exclude a tag. To track the same metric for several endpoints, add it once per endpoint, each with its own tag filter.
      * **Fallback** (optional): the value Runway uses when Datadog returns no data for the metric on a day.
  * **Fetch one version per request**: use this when Datadog rejects or truncates queries that return too many versions. You can leave it unchecked unless data is missing.
  * **Tag filters for all metrics** (optional): key/value tag filters applied to every metric.
  * **Skip filtering metrics by service**: use this when your metrics don't expose a `service` tag. If the metric name is shared across apps, add an app-specific tag filter.
  * **Use custom Datadog service value**: use this when your Datadog service value doesn't match the App Store bundle ID.
* Configuring RUM:&#x20;

<figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FTY3rBOzqXoLLma4Sepji%2Fimage.png?alt=media&amp;token=3090a052-0279-4071-91ba-fb1335e900ba" alt="" width="375"><figcaption></figcaption></figure>

* Runway supports RUM events of the **Action event type** with **custom** action types. Event metrics must be added as *measures* before they can be configured in Runway. You can read about adding facets/measures from custom attributes in Datadog's documentation [here](https://docs.datadoghq.com/real_user_monitoring/guide/send-rum-custom-actions/?tab=npm#create-facets-and-measures-on-attributes). Once you've added your custom attribute as a facet, it can be configured as an event metric in Runway using the facet's *path*. Note that the leading `@` is not required.
* See below for an example Event name + Metric name pair that monitors the custom `edit_item` event for a bill-splitting app, and the associated `amount` metric:
  * Event name: `edit_item`

    * This is the **action name** of the custom Action event

    <figure><img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FzRA5vzhxwfJm8tEX0fHt%2Fimage.png?alt=media&amp;token=eb960584-fd90-47ef-a31f-942ef6a834f5" alt=""><figcaption></figcaption></figure>

    * Metric name: `context.amount`
      * This is the `amount` measure that's been configured from the `amount` custom attribute
* ![](https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FVOH7W4QaT5rHRsFCgff2%2Fimage.png?alt=media\&token=a35327f0-fcb6-40a5-b2c1-66ae998336a6)<img src="https://727226624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjFmyReUsbJqDjHEAlW%2Fuploads%2FZJ1npucoXxNDmsK5vciL%2Fimage.png?alt=media&amp;token=0e900fce-c8a4-4e3f-b8ca-90e4fe544770" alt="" data-size="original">

  * You can view a full list of available custom actions by going to UX Monitoring > Sessions & Replays and filtering for Actions where `@action.type:custom`
  *

  ```
  <figure><img src="/files/bqpshZfJuRQftwSOaZIh" alt=""><figcaption></figcaption></figure>
  ```

  * Additional event types (e.g. `Views`, `Sessions`, and `Resources`) are not currently supported. Out-of-the-box action types (like `application_start`) are also not supported.
  * For a complete list of available metric types that Runway generates from your selected events, visit the [Metric Types documentation](https://docs.runway.team/using-runway/app-settings/health-metrics-settings.md#metric-types).

{% hint style="info" %}
The events you select as part of the integration setup will be surfaced in the [**Rollout**](https://docs.runway.team/using-runway/rollout.md) view of each release. You can also configure [health metrics](https://docs.runway.team/using-runway/app-settings/health-metrics-settings.md) that define acceptable thresholds for any of these events, associate metrics with [rollout automations](https://docs.runway.team/automations/types-of-automations.md#halt-unstable-phased-releases) and more!
{% endhint %}

{% hint style="info" %}
When selected events include an associated metric, Runway will compute additional metrics automatically, such as Average value, Median value, and percentile metrics. For more information on Datadog metrics including default metrics collected, visit their [documentation](https://docs.datadoghq.com/real_user_monitoring/browser/data_collected/).
{% endhint %}
