---
title: OpenTelemetry Metrics Destination
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Observability Pipelines > Destinations > OpenTelemetry > OpenTelemetry
  Metrics Destination
---

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

# OpenTelemetry Metrics Destination
Available for:
{% icon name="icon-metrics" /%}
 Metrics 
## Overview{% #overview %}

Use Observability Pipelines' OpenTelemetry destination to send metrics over HTTP/S to an OpenTelemetry (OTel) Collector or another OpenTelemetry Protocol (OTLP)-compatible endpoint.

## Set up destination{% #set-up-destination %}

{% alert level="danger" %}
For Secrets Management: Only enter the identifier for the HTTP/S Client URI and, if applicable, the TLS key pass. Do not enter the actual values.
{% /alert %}

Configure the OpenTelemetry destination when you [set up a pipeline](https://docs.datadoghq.com/observability_pipelines/configuration/set_up_pipelines.md). You can set up a pipeline in the [UI](https://app.datadoghq.com/observability-pipelines), using the [API](https://docs.datadoghq.com/api/latest/observability-pipelines.md), or with [Terraform](https://registry.terraform.io/providers/datadog/datadog/latest/docs/resources/observability_pipeline). The steps in this section are configured in the UI.

After you select the OpenTelemetry destination in the pipeline UI, enter the identifier for your HTTP/S Client URI. An example of the HTTP/S URI endpoint that the identifier references: `http://localhost:4319/v1/metrics`. If you leave the identifier field blank, the default is used.

**Notes**:

- The Worker can only send counter, gauge, and histogram metrics to OpenTelemetry. OpenTelemetry does not support other metrics types, so the Worker drops them. See Filter out unsupported metrics for more information.
- Datadog recommends setting your OTLP receiver to allow out-of-order samples because the Worker doesn't reorder metrics and some OTLP receivers reject out-of-order samples. See Allow out-of-order samples for more information.
- If you enter secret identifiers and then choose to use environment variables, the environment variable is the identifier entered and prepended with `DD_OP_`. For example, if you entered `PASSWORD_1` for a password identifier, the environment variable for that password is `DD_OP_PASSWORD_1`.

### Optional settings{% #optional-settings %}

#### Enable TLS{% #enable-tls %}

Toggle the switch to **Enable TLS**.

- If you are using Secrets Management, enter the identifier for the key pass. See Secret defaults for the default used if the field is left blank.
- Enter the following certificate and key files:
  - `Server Certificate Path`: The path to the certificate file that has been signed by your Certificate Authority (CA) root file in DER, PEM, or CRT (X.509).
  - (Optional) `CA Certificate Path`: The path to the certificate file that is your Certificate Authority (CA) root file in DER, PEM, or CRT (X.509).
  - (Optional) `Private Key Path`: The path to the `.key` private key file that belongs to your Server Certificate Path in DER, PEM, or CRT (PKCS #8) format.
  - **Notes**:
    - The configuration data directory `/var/lib/observability-pipelines-worker/config/` is automatically appended to the file paths. See [Advanced Worker Configurations](https://docs.datadoghq.com/observability_pipelines/configuration/install_the_worker/advanced_worker_configurations.md) for more information.
    - The file must be readable by the `observability-pipelines-worker` group and user.

#### Buffering{% #buffering %}

Toggle the switch to enable **Buffering Options**. Enable a configurable buffer on your destination to ensure intermittent latency or an outage at the destination doesn't create immediate backpressure, and allow events to continue to be ingested from your source. Disk buffers can also increase pipeline durability by writing data to disk, ensuring buffered data persists through a Worker restart. See [Destination buffers](https://docs.datadoghq.com/observability_pipelines/scaling_and_performance/buffering_and_backpressure.md#destination-buffers) for more information.

- If left unconfigured, your destination uses a memory buffer with a capacity of 500 events.
- To configure a buffer on your destination:
  1. Select the buffer type you want to set (**Memory** or **Disk**).
  1. Enter the buffer size and select the unit.
     1. Maximum memory buffer size is 128 GB.
     1. Maximum disk buffer size is 5 TB.
        - **Note**: For Worker versions 2.20.x and older, the maximum disk buffer size is 500 GB.
  1. In the **Behavior on full buffer** dropdown menu, select whether you want to **block** events or **drop new events** when the buffer is full.

## Filter out unsupported metrics{% #filter-out-unsupported-metrics %}

The Worker can only send counter, gauge, and histogram metrics to OpenTelemetry. The following Datadog metrics are not supported because they cannot be converted to OTLP format:

- StatsD-type metrics
- Distribution metrics
- Sketch metrics

If one of these metrics is in a batch to be encoded and sent to OpenTelemetry, the Worker drops the unsupported metric, logs an error, and updates the `component_error_total` metric. Datadog recommends using a [filter processor](https://docs.datadoghq.com/observability_pipelines/processors/filter.md) to filter out unsupported metric types.

## Allow out-of-order samples{% #allow-out-of-order-samples %}

The Worker doesn't always send metrics in the correct order for a given series because it doesn't reorder metrics. For example, if the first batch of metrics contains metrics with timestamps: `10:03`, `10:04`, `10:05` and the second batch contains metrics with timestamps: `10:01`, `10:02`, `10:06`, the Worker does not reorder those metrics before sending them out.

Because some OTLP receivers, such as the Prometheus OTLP receiver, reject out-of-order samples, the second batch of metrics gets rejected by the receiver. As a result, the Worker logs a Bad Request (`400`) error and the entire batch that was rejected gets dropped, even if the OTLP receiver accepted some of the valid metrics in the batch.

Datadog recommends setting your OTLP receiver to allow out-of-order samples to prevent out-of-order samples from getting dropped.

## Secret defaults{% #secret-defaults %}

These are the defaults used for secret identifiers and environment variables.

{% tab title="Secrets Management" %}

- HTTP/S Client URI endpoint identifier
  - References the HTTP/S URI endpoint to which the Worker sends OpenTelemetry data. An example of the HTTP/S URI endpoint that the identifier references: `http://localhost:4319/v1/metrics`.
  - The default identifier is `DESTINATION_OTEL_HTTP_CLIENT_URI`.
- HTTP/S Client TLS passphrase identifier (when TLS is enabled):
  - The default identifier is `DESTINATION_OTEL_HTTP_CLIENT_KEY_PASS`.

{% /tab %}

{% tab title="Environment Variables" %}

- HTTP/S client URI endpoint, such as `http://localhost:4319/v1/metrics`:
  - The HTTP/S URI endpoint to which the Worker sends OpenTelemetry data.
  - The default environment variable is `DD_OP_DESTINATION_OTEL_HTTP_CLIENT_URI`.
- HTTP/S Client TLS passphrase (when enabled):
  - The default environment variable is `DD_OP_DESTINATION_OTEL_HTTP_CLIENT_KEY_PASS`.

{% /tab %}

## Health metrics{% #health-metrics %}

See [Component metrics](https://docs.datadoghq.com/observability_pipelines/monitoring_and_troubleshooting/pipeline_usage_metrics.md#component-metrics) and [Destination buffer metrics](https://docs.datadoghq.com/observability_pipelines/scaling_and_performance/buffering_and_backpressure.md?tab=destinations#buffer-metrics) for more information on metrics emitted by all destinations. To filter or group by OpenTelemetry destination metrics, use the tag `component_type:opentelemetry`.

## How the destination works{% #how-the-destination-works %}

### Event batching{% #event-batching %}

A batch of events is flushed when one of these conditions occurs. See [event batching](https://docs.datadoghq.com/observability_pipelines/destinations.md#event-batching) for more information.

| Maximum Events | Maximum Size (MB) | Timeout (seconds) |
| -------------- | ----------------- | ----------------- |
| N/A            | 10                | 1                 |
