---
title: Get experiment results
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Experiments
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

# Get experiment results{% #get-experiment-results %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                 |
| ----------------- | ---------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/experiments/{experiment_id}/results |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/experiments/{experiment_id}/results |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/experiments/{experiment_id}/results      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/experiments/{experiment_id}/results      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/experiments/{experiment_id}/results  |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/experiments/{experiment_id}/results |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/experiments/{experiment_id}/results     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/experiments/{experiment_id}/results |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/experiments/{experiment_id}/results |

### Overview

Get an experiment's computed results: per-variant statistical analysis for the latest successful run. A historical run cannot be selected. Unavailable analysis statistics, including `p_value` and `confidence_interval`, are omitted. The `numerator`, `denominator`, and `variant_metric_value` fields can be null when their values are unavailable. Do not treat an omitted or null value as zero. This endpoint requires the `product_analytics_experiments_read` permission.

OAuth apps require the `product_analytics_experiments_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#experiments) to access this endpoint.



### Arguments

#### Path Parameters

| Name                            | Type   | Description                 |
| ------------------------------- | ------ | --------------------------- |
| experiment_id [*required*] | string | The UUID of the experiment. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
List of variant result resources.

| Parent field        | Field                       | Type      | Description                                                                                                                                                                                                                                |
| ------------------- | --------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|                     | data [*required*]      | [object]  | Resources returned in this response.                                                                                                                                                                                                       |
| data                | attributes                  | object    | Details of the variant result.                                                                                                                                                                                                             |
| attributes          | assignment_count            | int64     | Number of subjects assigned to this variant.                                                                                                                                                                                               |
| attributes          | experiment_id               | string    | ID of the experiment associated with this result.                                                                                                                                                                                          |
| attributes          | is_control                  | boolean   | Whether this variant is the experiment's control.                                                                                                                                                                                          |
| attributes          | metrics                     | [object]  | Metrics reported for this variant.                                                                                                                                                                                                         |
| metrics             | analyses                    | [object]  | Statistical analyses calculated for this metric and variant.                                                                                                                                                                               |
| analyses            | confidence_interval         | object    | Lower and upper bounds of the reported statistical interval.                                                                                                                                                                               |
| confidence_interval | lower                       | double    | Lower bound of the reported interval.                                                                                                                                                                                                      |
| confidence_interval | upper                       | double    | Upper bound of the reported interval.                                                                                                                                                                                                      |
| analyses            | confidence_level            | double    | Configured nominal confidence level. Interval bounds can use an adjusted level for multiple testing or hybrid methods.                                                                                                                     |
| analyses            | evsi                        | double    | Expected reduction in minimum expected regret from collecting more sample data.                                                                                                                                                            |
| analyses            | expectation_above_zero      | double    | Expected effect when the effect is positive.                                                                                                                                                                                               |
| analyses            | expectation_below_zero      | double    | Expected effect when the effect is negative.                                                                                                                                                                                               |
| analyses            | global_lift                 | double    | Estimated lift across the population. Calculated as metric coverage multiplied by the experiment lift.                                                                                                                                     |
| analyses            | global_lift_lower_bound     | double    | Lower bound of the estimated lift across the population.                                                                                                                                                                                   |
| analyses            | global_lift_upper_bound     | double    | Upper bound of the estimated lift across the population.                                                                                                                                                                                   |
| analyses            | is_cuped_adjusted           | boolean   | Whether CUPED used pre-experiment data to reduce variance in this result.                                                                                                                                                                  |
| analyses            | is_unreliable               | boolean   | Whether the statistical result is marked as unreliable.                                                                                                                                                                                    |
| analyses            | lift_type                   | enum      | Whether the reported lift is relative or absolute. Allowed enum values: `RELATIVE,ABSOLUTE,UNKNOWN`                                                                                                                                        |
| analyses            | method                      | enum      | Statistical method used to calculate this result. Allowed enum values: `FIXED_SAMPLE,BAYESIAN,SEQUENTIAL,SEQUENTIAL_FIXED_HYBRID,UNKNOWN`                                                                                                  |
| analyses            | minimum_expected_regret     | double    | The smaller expected opportunity cost of choosing treatment or control.                                                                                                                                                                    |
| analyses            | p_value                     | double    | Probability, under the no-effect hypothesis, of a result at least as extreme as the observed result.                                                                                                                                       |
| analyses            | point_estimate              | double    | Estimated difference between the variant and control for this metric.                                                                                                                                                                      |
| analyses            | probability_above_zero      | double    | Estimated probability that the effect is greater than zero.                                                                                                                                                                                |
| analyses            | probability_below_zero      | double    | Estimated probability that the effect is less than zero.                                                                                                                                                                                   |
| analyses            | standard_error              | double    | Estimated uncertainty in the effect estimate.                                                                                                                                                                                              |
| analyses            | unreliable_reason           | enum      | Reason that the statistical result is marked as unreliable. Allowed enum values: `CONTROL_DENOMINATOR_NEAR_ZERO,TREATMENT_DENOMINATOR_NEAR_ZERO,CONTROL_AND_TREATMENT_DENOMINATORS_NEAR_ZERO,CONTROL_MEAN_NEAR_ZERO,ZERO_VARIANCE,UNKNOWN` |
| analyses            | variant_metric_value        | double    | Metric value calculated for this variant.                                                                                                                                                                                                  |
| analyses            | z_score                     | double    | Standardized statistic used to compare the observed effect with zero.                                                                                                                                                                      |
| metrics             | assignment_count            | int64     | Number of subjects assigned to this variant.                                                                                                                                                                                               |
| metrics             | coverage                    | double    | Estimated share of the global metric total from the eligible population if that population received control. The estimate can exceed 1.                                                                                                    |
| metrics             | coverage_summary            | object    | Population totals and allocation used to calculate metric coverage.                                                                                                                                                                        |
| coverage_summary    | control_total               | double    | Total metric value for the control population in the coverage calculation.                                                                                                                                                                 |
| coverage_summary    | coverage                    | double    | Estimated share of the global metric total from the eligible population if that population received control. The estimate can exceed 1.                                                                                                    |
| coverage_summary    | coverage_unavailable_reason | string    | Reason that metric coverage could not be calculated.                                                                                                                                                                                       |
| coverage_summary    | eligible_population_total   | double    | Estimated metric total for the eligible population if that population received control.                                                                                                                                                    |
| coverage_summary    | experiment_total            | double    | Total metric value for the experiment population in the coverage calculation.                                                                                                                                                              |
| coverage_summary    | global_metric_total         | double    | Observed metric total across subjects inside and outside the experiment.                                                                                                                                                                   |
| coverage_summary    | traffic_allocation          | double    | Fraction of eligible traffic allocated to the experiment, weighted by time.                                                                                                                                                                |
| metrics             | coverage_unavailable_reason | string    | Reason that metric coverage could not be calculated.                                                                                                                                                                                       |
| metrics             | denominator                 | double    | Aggregated denominator value for this metric and variant.                                                                                                                                                                                  |
| metrics             | desired_change              | enum      | Direction of metric change considered desirable. Allowed enum values: `METRIC_INCREASES,METRIC_DECREASES,UNKNOWN`                                                                                                                          |
| metrics             | metric_id                   | string    | ID of the metric represented by this entry.                                                                                                                                                                                                |
| metrics             | metric_name                 | string    | Display name of the metric represented by this entry.                                                                                                                                                                                      |
| metrics             | numerator                   | double    | Aggregated numerator value for this metric and variant.                                                                                                                                                                                    |
| metrics             | sub_metric_property_name    | string    | Name of the property used to split this metric result.                                                                                                                                                                                     |
| metrics             | sub_metric_property_value   | string    | Property value represented by this split metric result.                                                                                                                                                                                    |
| attributes          | variant_key                 | string    | Key that identifies the experiment variant.                                                                                                                                                                                                |
| attributes          | variant_name                | string    | Display name of the experiment variant.                                                                                                                                                                                                    |
| data                | id [*required*]        | string    | ID of the variant result.                                                                                                                                                                                                                  |
| data                | type [*required*]      | enum      | Experiment variant results resource type. Allowed enum values: `experiment-variant-results`                                                                                                                                                |
|                     | meta                        | object    | Information about when experiment results were updated and whether they are stale.                                                                                                                                                         |
| meta                | is_stale                    | boolean   | Whether the saved results require a refresh or their freshness cannot be confirmed. See stale_reasons for details.                                                                                                                         |
| meta                | results_last_updated        | date-time | Time when the experiment results were last updated.                                                                                                                                                                                        |
| meta                | stale_reasons               | [string]  | Reasons the saved experiment results are stale.                                                                                                                                                                                            |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "assignment_count": "integer",
        "experiment_id": "string",
        "is_control": false,
        "metrics": [
          {
            "analyses": [
              {
                "confidence_interval": {
                  "lower": "number",
                  "upper": "number"
                },
                "confidence_level": "number",
                "evsi": "number",
                "expectation_above_zero": "number",
                "expectation_below_zero": "number",
                "global_lift": "number",
                "global_lift_lower_bound": "number",
                "global_lift_upper_bound": "number",
                "is_cuped_adjusted": false,
                "is_unreliable": false,
                "lift_type": "string",
                "method": "string",
                "minimum_expected_regret": "number",
                "p_value": "number",
                "point_estimate": "number",
                "probability_above_zero": "number",
                "probability_below_zero": "number",
                "standard_error": "number",
                "unreliable_reason": "string",
                "variant_metric_value": "number",
                "z_score": "number"
              }
            ],
            "assignment_count": "integer",
            "coverage": "number",
            "coverage_summary": {
              "control_total": "number",
              "coverage": "number",
              "coverage_unavailable_reason": "string",
              "eligible_population_total": "number",
              "experiment_total": "number",
              "global_metric_total": "number",
              "traffic_allocation": "number"
            },
            "coverage_unavailable_reason": "string",
            "denominator": "number",
            "desired_change": "METRIC_INCREASES",
            "metric_id": "string",
            "metric_name": "string",
            "numerator": "number",
            "sub_metric_property_name": "string",
            "sub_metric_property_value": "string"
          }
        ],
        "variant_key": "string",
        "variant_name": "string"
      },
      "id": "550e8400-e29b-41d4-a716-446655440000:treatment",
      "type": "experiment-variant-results"
    }
  ],
  "meta": {
    "is_stale": true,
    "results_last_updated": "2026-08-05T09:25:00Z",
    "stale_reasons": [
      "ANALYSIS_PLAN_CHANGED"
    ]
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Malformed experiment ID (not a valid UUID), or the experiment is not configured for analysis.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="401" %}
Missing or invalid authentication.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Authenticated caller lacks the product_analytics_experiments_read permission.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
No experiment with this ID exists, or results are not available for it yet.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="409" %}
The experiment's metrics are incompatible with analysis.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export experiment_id="550e8400-e29b-41d4-a716-446655440000" \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/experiments/${experiment_id}/results" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" 

                
##### 

```python
"""
Get experiment results returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.experiments_api import ExperimentsApi
from uuid import UUID

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
    api_instance = ExperimentsApi(api_client)
    response = api_instance.get_experiment_results(
        experiment_id=UUID("550e8400-e29b-41d4-a716-446655440000"),
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
##### 

```ruby
# Get experiment results returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::ExperimentsAPI.new
p api_instance.get_experiment_results("550e8400-e29b-41d4-a716-446655440000")
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
##### 

```go
// Get experiment results returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
	"github.com/google/uuid"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewExperimentsApi(apiClient)
	resp, r, err := api.GetExperimentResults(ctx, uuid.MustParse("550e8400-e29b-41d4-a716-446655440000"))

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ExperimentsApi.GetExperimentResults`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `ExperimentsApi.GetExperimentResults`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
##### 

```java
// Get experiment results returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ExperimentsApi;
import com.datadog.api.client.v2.model.ExperimentsVariantResultsV2DTOArray;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    ExperimentsApi apiInstance = new ExperimentsApi(defaultClient);

    try {
      ExperimentsVariantResultsV2DTOArray result =
          apiInstance.getExperimentResults(UUID.fromString("550e8400-e29b-41d4-a716-446655440000"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ExperimentsApi#getExperimentResults");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
##### 

```rust
// Get experiment results returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_experiments::ExperimentsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = ExperimentsAPI::with_config(configuration);
    let resp = api
        .get_experiment_results(
            Uuid::parse_str("550e8400-e29b-41d4-a716-446655440000").expect("invalid UUID"),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
{% /tab %}
