> For the complete documentation index, see [llms.txt](https://docs.thousandeyes.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms/elastic.md).

# Elastic

Elastic Observability is a search-powered analytics platform that unifies logs, metrics, traces, and uptime data for actionable insights. This guide explains how to integrate ThousandEyes metrics with Elastic using OpenTelemetry.

For more information about sending metrics to Elastic using OpenTelemetry, see [Elastic Observability: Upstream OpenTelemetry Collectors and language SDKs](https://www.elastic.co/guide/en/observability/current/apm-open-telemetry-direct.html).

## Prerequisites

* You have [created a ThousandEyes test](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms#create-a-test).
* You have obtained the **Managed OTLP endpoint** for your Elastic project:
  1. In the **Elastic project dashboard**, go to **Connection alias**.
  2. Click **Edit**.
  3. Copy the **Managed OTLP endpoint**.

     Example: `https://my-observability-project-e49e89.ingest.us-central1.gcp.elastic.cloud`
* You have generated an Elastic API key:
  1. In your Elastic dashboard, go to **Cloud > Projects**.
  2. Select a project.
  3. In the project dashboard, under **API keys**, click **Manage project API keys**.
  4. Click **+Create API key**.
  5. Enter a **Name**.
  6. Click **Create API key**.

     Copy the API key to use it to send telemetry data to Elastic.

## Stream OpenTelemetry Metrics to Elastic

### Step 1: Create a Metrics Integration

#### Using the ThousandEyes UI

1. In ThousandEyes, go to **Manage > Integration 1.0**.
2. Click **+New Integration** and select **OpenTelemetry Integration**.
3. Enter a **Name** for the integration.
4. Set the **Target** to **GRPC**.
5. For the **Endpoint URL**, enter the **Managed OTLP endpoint** for your Elastic project (see [Prerequisites](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms/elastic#prerequisites)).
6. For **Preset Configurations**, select **Elastic**.
7. For **Auth Type**, select **Custom**.
8. Add the following **Custom Headers**: `"Authorization": "ApiKey {TOKEN}"`.

   Use your Elastic API key. Make sure to prefix it with `ApiKey`. For example: `ApiKey {TOKEN}`.
9. For the OpenTelemetry **Signal**, select **Metric**.
10. For the **Data Model Version**, select **v2**.
11. Select a **test**.

    For more information on creating a test, see [General Setup Instructions](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms#general-setup-instructions).
12. Click **Save**.

#### Using the ThousandEyes API

Create the HTTP stream programmatically:

```curl
curl -v -XPOST https://api.thousandeyes.com/v7/streams \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -d '{
    "type": "opentelemetry",
    "testMatch": [{
      "id": "281474976717575",
      "domain": "cea"
    }],
    "endpointType": "grpc",
    "signal": "metric",
    "streamEndpointUrl": "{STREAM_ENDPOINT_URL}",
    "customHeaders": {
      "Authorization": "ApiKey {TOKEN}"
    }
  }'
```

Replace `{TOKEN}` and `{STREAM_ENDPOINT_URL}` with your Elastic API key and APM endpoint.

### ThousandEyes Dashboard in Elastic

1. In Elastic, go to **Observability > Metrics**.
2. Use **Metrics Explorer** to search for ThousandEyes metrics and apply filters.

![ThousandEyes Dashboard in Elastic](/files/CINIo9VV7zu8SUr9dDr2)

## Stream OpenTelemetry Traces to Elastic

### Step 1: Create a Traces Integration

#### Using the ThousandEyes UI

1. In ThousandEyes, go to **Manage > Integration 1.0**.
2. Click **+New Integration** and select **OpenTelemetry Integration**.
3. Enter a **Name** for the integration.
4. Set the **Target** to **GRPC**.
5. For the **Endpoint URL**, enter the **Managed OTLP endpoint** for your Elastic project (see [Prerequisites](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms/elastic#prerequisites)).
6. For **Preset Configurations**, select **Elastic**.
7. For **Auth Type**, select **Custom**.
8. Add the following **Custom Headers**: `"Authorization": "ApiKey {TOKEN}"`

   Use your Elastic API key. Make sure to prefix it with `ApiKey`.

   For example: `ApiKey {TOKEN}`.
9. For the OpenTelemetry **Signal**, select **Trace**.
10. Select a **test**.

    For more information on creating a test, see [General Setup Instructions](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms#general-setup-instructions).
11. Click **Save**.

#### Using the ThousandEyes API

Create the HTTP stream programmatically:

```curl
curl -v -XPOST https://api.thousandeyes.com/v7/streams \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -d '{
    "type": "opentelemetry",
    "testMatch": [{
      "id": "281474976717575",
      "domain": "cea"
    }],
    "endpointType": "grpc",
    "signal": "trace",
    "streamEndpointUrl": "{STREAM_ENDPOINT_URL}",
    "customHeaders": {
      "Authorization": "ApiKey {TOKEN}"
    }
  }'
```

Replace `{TOKEN}` and `{STREAM_ENDPOINT_URL}` with your Elastic API key and APM endpoint.

### Step 2: Visualize Traces in Elastic

1. In Elastic, navigate to **Observability > Applications > Traces**.
2. Select the relevant service.
3. Open the **Traces** view and apply filters.

![ThousandEyes Traces in Elastic](/files/8HQOy2lPbl3Lh2D6RY5G)

## Stream OpenTelemetry Logs to Elastic

### Step 1: Create a Logs Integration

#### Using the ThousandEyes UI

1. In ThousandEyes, go to **Manage > Integration 1.0**.
2. Click **+New Integration** and select **OpenTelemetry Integration**.
3. Enter a **Name** for the integration.
4. Set the **Target** to **GRPC**.
5. For the **Endpoint URL**, enter the **Managed OTLP endpoint** for your Elastic project (see [Prerequisites](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms/elastic#prerequisites)).
6. For **Preset Configurations**, select **Elastic**.
7. For **Auth Type**, select **Custom**.
8. Add the following **Custom Headers**: `"Authorization": "ApiKey {TOKEN}"`

   Use your Elastic API key. Make sure to prefix it with `ApiKey`.

   For example: `ApiKey {TOKEN}`.
9. For the OpenTelemetry **Signal**, select **Log**.
10. Select a **test**.

    For more information on creating a test, see [General Setup Instructions](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms#general-setup-instructions).
11. Click **Save**.

#### Using the ThousandEyes API

Create the HTTP stream programmatically:

```curl
curl -v -XPOST https://api.thousandeyes.com/v7/streams \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -d '{
    "type": "opentelemetry",
    "endpointType": "grpc",
    "signal": "log",
    "streamEndpointUrl": "{STREAM_ENDPOINT_URL}",
    "customHeaders": {
      "Authorization": "ApiKey {TOKEN}"
    }
  }'
```

Replace `{TOKEN}` and `{STREAM_ENDPOINT_URL}` with your Elastic API key and APM endpoint.

### Step 2: Visualize Logs in Elastic

1. In Elastic, navigate to **Observability > Discover**.
2. Use the **Logs Explorer** to search for ThousandEyes log entries and apply filters.

   For example: `resource.attributes.thousandeyes.account.id : *`

![ThousandEyes Logs in Elastic](/files/7sgqKm0sIUDyCEh0XTaR)
