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 #
| Path | Storage | When |
|---|---|---|
| Collector (EDOT or contrib) + elasticsearch exporter | Native OTel (or ECS) | Self-hosted, full pipeline control |
| Managed OTLP endpoint | Native OTel | Elastic Cloud: nothing to operate on the receiving side |
| APM Server (OTLP) | Converted to ECS | Existing Elastic APM, classic APM agents |
2. Storage and data streams #
Native OTel or ECS.
Storage modes #
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 tologs-*,metrics-*andtraces-*.
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 10Common 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.
