Send OpenTelemetry Telemetry Directly to Elasticsearch (No APM Server Needed!)

If you're using the OpenTelemetry Collector Contrib and want to send telemetry directly to Elasticsearch without relying on Logstash or Elastic APM Server, you're in luck.

As of recent versions, the elasticsearch exporter in OpenTelemetry Collector Contrib supports logs, metrics, traces, and even profiling data — all natively, all directly into Elasticsearch!

In this guide, we’ll show you how to configure the OpenTelemetry Collector on any platform (including Windows) to forward telemetry to Elasticsearch, bypassing the APM Server.


Architecture Overview

[App with OTel SDK or Agent]
         ↓ OTLP
[OpenTelemetry Collector]
         ↓ elasticsearch exporter
[Elasticsearch]
         ↓
[Kibana]
  • No APM Server

  • No Logstash

  • Just pure OpenTelemetry ➝ Elasticsearch ➝ Kibana 🔥


Why This is Awesome

  • No need to run Elastic APM Server

  • Works with Elasticsearch 7.17+ and 8.x

  • Supports logs, metrics, traces, and profiles

  • Configurable mapping.mode for better indexing/querying

  • Clean OTLP-to-Elastic pipeline


Prerequisites

  • Elasticsearch 7.17 or 8.x running and accessible

  • Kibana (for visualization)

  • OpenTelemetry Collector Contrib binary

  • Optional: an app using an OpenTelemetry SDK/agent (Java, Python, etc.)


Sample OpenTelemetry Collector Config (otel-config.yaml)

Prepare the Configuration

Create a config file named otel-config.yaml in C:\otel-collector, and paste the config as shown below (with otlp receiver and elasticsearch exporter).

Make sure to update:

  • Elasticsearch endpoint (default is http://localhost:9200)

  • Any TLS or authentication settings, if needed

receivers:
  otlp:
    protocols:
      http:

processors:
  batch:

exporters:
  elasticsearch:
    endpoints: ["http://localhost:9200"]
    tls:
      insecure: true

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [elasticsearch]

    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [elasticsearch]

    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [elasticsearch]

Download and Set Up OpenTelemetry Collector on Windows

To run the OpenTelemetry Collector on Windows, follow these steps:

Download the Collector

  1. Visit the OpenTelemetry Collector Releases.

  2. Look for the latest otelcol-contrib release.

  3. Download the Windows AMD64 zip file — e.g.,
    otelcol-contrib_windows_amd64.zip

  4. Extract the contents to a folder, e.g.: C:\otel-collector


Run the OpenTelemetry Collector

otelcol-contrib.exe --config otel-config.yaml

Or in Linux/macOS:

./otelcol-contrib --config otel-config.yaml

Make sure your app is sending OTLP telemetry to the correct endpoint (http://<otel-host>:4318 for HTTP-based OTLP).


Visualizing Data in Kibana

  • Visit Kibana (http://localhost:5601)

  • Use the Discover tab to search telemetry in:

    • otel-logs-*

    • otel-metrics-*

    • otel-traces-*

  • Create dashboards or use Lens/TSVB for metrics

You won’t get APM-specific UI (service maps, trace waterfalls) — but you can build dashboards manually.


Bonus: Generate Test Data

Try OpenTelemetry Demo App or run a simple instrumented app (like Spring Boot + OTel Java agent) to test logs/traces/metrics flowing into Elasticsearch.


Caveats

  • No out-of-the-box Elastic APM UI features like service maps, span graphs, or anomaly detection.

  • otel mapping mode requires recent Elasticsearch versions.

  • Profiling data support is experimental.


Final Thoughts

With the enhanced elasticsearch exporter in OpenTelemetry Collector Contrib, sending logs, metrics, traces, and profiles directly to Elasticsearch is not only possible — it's practical, clean, and fast.

Whether you're running in cloud or on-prem, this setup removes the dependency on APM Server or Logstash while still leveraging the power of the Elastic Stack.


Resources


0
Subscribe to my newsletter

Read articles from Venu Madhav Emmadi directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Venu Madhav Emmadi
Venu Madhav Emmadi