RousselTMLEARNING

Observability

OpenTelemetry and Elasticsearch: compatibility and architecture

Send OpenTelemetry to Elasticsearch: Collector and elasticsearch exporter, managed OTLP endpoint, APM Server, EDOT distribution, native OTel or ECS storage and data streams.

1. Elasticsearch and OpenTelemetry #

Compatibility that became native.

Context #

OpenTelemetry (OTel) is the open standard for collecting traces, metrics and logs. Elastic donated its ECS schema to the project in 2023 to converge with OTel semantic conventions, then made Elasticsearch able to store OTel data as is, without conversion, and publishes its own EDOT distribution (Elastic Distribution of OpenTelemetry: Collector and SDKs).

Depending on the version: native OTel storage arrived in preview with Elastic 8.16 and became general in 9.x; the managed OTLP endpoint is offered on Elastic Cloud (Serverless, then Hosted). Check your version's compatibility matrix.

Three paths #

Collector, managed OTLP endpoint or APM Server.
PathStorageWhen
Collector (EDOT or contrib) + elasticsearch exporterNative OTel (or ECS)Self-hosted, full pipeline control
Managed OTLP endpointNative OTelElastic Cloud: nothing to operate on the receiving side
APM Server (OTLP)Converted to ECSExisting Elastic APM, classic APM agents

2. Storage and data streams #

Native OTel or ECS.

Storage modes #

otel mode, ecs mode and data streams.

In otel mode, resource attributes stay under resource.attributes.* and signal attributes under attributes.*: existing OpenTelemetry queries and dashboards apply directly. ecs mode translates to ECS fields (service.name, host.name), useful to reuse historical Elastic dashboards.

Reference configuration #

receivers:
  otlp:
    protocols:
      grpc: { endpoint: 0.0.0.0:4317 }
      http: { endpoint: 0.0.0.0:4318 }
processors:
  batch: {}
  resource:
    attributes:
      - { key: deployment.environment, value: lab, action: upsert }
exporters:
  elasticsearch:
    endpoint: https://es.exemple.fr:9200
    api_key: ${env:ES_API_KEY}
    mapping:
      mode: otel
service:
  pipelines:
    traces:  { receivers: [otlp], processors: [resource, batch], exporters: [elasticsearch] }
    metrics: { receivers: [otlp], processors: [resource, batch], exporters: [elasticsearch] }
    logs:    { receivers: [otlp], processors: [resource, batch], exporters: [elasticsearch] }
Good practice: Create an API key dedicated to the Collector, limited to writing to logs-*, metrics-* and traces-*.

3. Kibana and OpenTelemetry #

Exploring the data.

Where to see the data #

  • Discover and ES|QL on *.otel-* data streams.
  • APM / Observability apps: services, traces, service map (with APM metrics computed by the EDOT Collector).
  • Dashboards and alerts on OTel metrics.
FROM traces-*.otel-*
| WHERE resource.attributes.service.name == "checkout"
| STATS p95 = PERCENTILE(duration, 95) BY name
| SORT p95 DESC | LIMIT 10
Common mistake: Using the contrib Collector without Elastic's APM connector or processor: traces are stored, but Kibana's APM views (latency, throughput, error rate per service) stay empty. The EDOT distribution includes these components.

Related articles

Transforms and enrich: summarising and enriching data in Elasticsearch

Build entity-centric indices with pivot and latest transforms, and enrich documents at ingest time with enric…

Ingesting OpenTelemetry logs into Elasticsearch

Collect and structure logs with the OpenTelemetry Collector (filelog receiver, operators, transform processor…

OpenTelemetry traces in Elasticsearch and Kibana APM

Instrument applications with OpenTelemetry or EDOT SDKs, send traces to Elasticsearch, get Kibana APM views, …

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!