Ingest metrics into a TSDS using the OTLP/HTTP endpoint

Elasticsearch accepts OpenTelemetry Protocol (OTLP) metrics on /_otlp/v1/metrics, one of the Elasticsearch OTLP/HTTP endpoint paths. The endpoint is a native ingest API, like the bulk API. To decide whether to use the OTLP endpoint for OpenTelemetry metrics, refer to When to use the Elasticsearch OTLP endpoint. In most setups, applications send metrics to the Elastic Cloud Managed OTLP Endpoint or to an Elastic Agent in Gateway mode rather than to this endpoint.

Elasticsearch stores metrics that arrive on /_otlp/v1/metrics as follows:

  • Elasticsearch writes records to time series data streams (TSDS). Built-in index templates create the data streams on first write, and routing follows the <type>-<dataset>.otel-<namespace> pattern.
  • The endpoint derives dimensions and metric mappings from OTLP metadata, so you don't need to set them up manually. Metric points are deduplicated based on their dimensions and timestamp.
  • Elasticsearch stores histogram metrics using the exponential_histogram or histogram field type, depending on your version and the histogram handling setting.
  • The endpoint preserves the temporality of each metric in a temporality dimension, so ES|QL time series queries and downsampling interpret counters and histograms correctly.

For request details, authentication, and limitations, refer to the Elasticsearch OTLP/HTTP endpoint reference.