Loading

Use OpenTelemetry with APM

Stack Serverless

OpenTelemetry is a set of APIs, SDKs, tooling, and integrations that enable the capture and management of telemetry data from your services and applications.

Elastic offers several distributions of OpenTelemetry. Each Elastic Distribution of OpenTelemetry is a customized version of an OpenTelemetry language SDK and the OpenTelemetry Collector, ready to send data to the Managed OTLP endpoint, APM Server, or directly to Elasticsearch.

The following diagrams show the reference architecture for OpenTelemetry with Elastic, depending on your deployment model.

With an Elastic Distribution of OpenTelemetry language SDK you have access to all the features of the OpenTelemetry SDK that it customizes, plus:

  • You can get access to SDK improvements and bug fixes contributed by the Elastic team before the changes are available upstream in the OpenTelemetry repositories.
  • The distribution configures the collection of tracing and metrics signals, applying opinionated defaults, such as which sources are collected by default.
  • By sending data through the EDOT Collector, you make sure to onboard infrastructure logs and metrics.

Get started with an Elastic Distribution of OpenTelemetry language SDK:

Important

For a complete overview of OpenTelemetry and Elastic, explore Elastic Distributions of OpenTelemetry.

The Elastic Stack natively supports the OpenTelemetry protocol (OTLP). This means trace data and metrics collected from your applications and infrastructure by an OpenTelemetry Collector or OpenTelemetry language SDK can be sent to the Elastic Stack.

You can set up an OpenTelemetry Collector, instrument your application with an OpenTelemetry language SDK that sends data to the Collector, and use the Collector to process and export the data to either the Managed OTLP endpoint or APM Server or the managed intake service.

This approach works well when you need to instrument a technology that Elastic doesn’t provide a solution for. For example, if you want to instrument C or C++ you could use the OpenTelemetry C++ client. However, there are some limitations when using upstream OpenTelemetry collectors and language SDKs, including:

  • Elastic can’t provide implementation support on how to use upstream OpenTelemetry tools.
  • You won’t have access to Elastic enterprise APM features.
  • You may experience problems with performance efficiency.

For more on the limitations associated with using upstream OpenTelemetry tools, refer to Limitations.

Get started with upstream OpenTelemetry Collectors and language SDKs →

Note

To understand the differences between Elastic Distributions of OpenTelemetry and upstream OpenTelemetry, refer to EDOT compared to upstream OpenTelemetry.

You can use the OpenTelemetry API/SDKs with Elastic APM agents to translate OpenTelemetry API calls to Elastic APM API calls. This allows you to reuse your existing OpenTelemetry instrumentation to create Elastic APM transactions and spans, avoiding vendor lock-in and having to redo manual instrumentation.

However, not all features of the OpenTelemetry API are supported when using this approach, and not all Elastic APM agents support this approach.

Find more details about how to use an OpenTelemetry API or SDK with an Elastic APM agent and which OpenTelemetry API features are supported in the APM agent documentation:

AWS Lambda functions can be instrumented with OpenTelemetry and monitored with Elastic Observability or Elastic Observability Serverless.

To get started, follow the official AWS Distribution for OpenTelemetry Lambda documentation, and configure the OpenTelemetry Collector to output traces and metrics to your Elastic cluster:

Get started with the AWS Distro for OpenTelemetry Lambda