OpenTelemetry for Erlang / Elixir

OpenTelemetry has solid support for the BEAM ecosystem, covering both Erlang and Elixir applications.
You can instrument Phoenix apps, LiveView, and other Elixir services.

Installation

Add the following dependencies to your Elixir mix.exs:

{:opentelemetry, "> 1.0"}, {:opentelemetry_exporter, "> 1.0"}
Run:
mix deps.get

Full installation instructions:
👉 OpenTelemetry Erlang/Elixir Getting Started

Auto-Instrumentation

Auto-instrumentation lets you automatically trace common libraries such as HTTP clients, database drivers, and more without needing to modify your code. OpenTelemetry provides auto-instrumentation libraries for many popular languages, making it fast to get started with tracing.

Some libraries like Phoenix and Ecto have automatic integration options.
You can enable automatic tracing with:

{:opentelemetry_phoenix, "> 1.0"}, {:opentelemetry_ecto, "> 1.0"}

Learn more:
👉 Phoenix Auto-Instrumentation

Manual Instrumentation

Manual instrumentation gives you full control over your traces, allowing you to create spans wherever needed. You can customize span names, attributes, and relationships to capture the most important parts of your application’s flow.

Manually create spans in Elixir:

:otel_tracer.start_span("my-operation")
your application logic
:otel_tracer.end_span()

Or in Elixir (friendly wrapper):

OpenTelemetry.Tracer.with_span "my-operation" do
your code
end

Learn more:
👉 Elixir Manual Tracing

Exporters

Once your application is instrumented, you need to export telemetry data. PlayerZero supports the OpenTelemetry Protocol (OTLP) over HTTP. You can configure your OpenTelemetry SDK to export traces, logs, and metrics to PlayerZero’s endpoint by setting the endpoint URL and API token.

To export telemetry to PlayerZero, configure the OTLP HTTP exporter:

OTEL_EXPORTER_OTLP_ENDPOINT=https://sdk.playerzero.app/otlp 
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer <your-playerzero-token> 
OTEL_TRACES_EXPORTER=otlp 
OTEL_METRICS_EXPORTER=otlp

Official reference:
👉 Elixir Exporter Setup

Optional: Using a Collector

Using an OpenTelemetry Collector is optional for most setups. A collector can help route telemetry to multiple destinations, perform transformations, or batch data efficiently. You might use a collector if you want to forward telemetry to both PlayerZero and another observability platform simultaneously.

You can forward Erlang/Elixir telemetry to a collector before it reaches PlayerZero.

For detailed language-specific instrumentation examples and full OpenTelemetry documentation, refer to the links below.