Elixir
Send OpenTelemetry traces from any Elixir or Phoenix server to Sophonz using the official opentelemetry Erlang/Elixir packages — no Sophonz package required.
There is no sophonz hex package, and you don't need one. Sophonz's collector speaks standard OTLP, so any Elixir service can send it traces using the official opentelemetry Erlang/Elixir packages, a few lines of application config, and environment variables for the connection details.
What you get
- The official Erlang/Elixir SDK —
opentelemetry+opentelemetry_api+opentelemetry_exporter, which ships an OTLP exporter that readsOTEL_EXPORTER_OTLP_ENDPOINT,OTEL_EXPORTER_OTLP_PROTOCOL, andOTEL_EXPORTER_OTLP_HEADERSautomatically. - Drop-in instrumentation packages for the libraries most Phoenix apps already use —
opentelemetry_phoenixfor controller/LiveView spans,opentelemetry_banditoropentelemetry_cowboyfor the HTTP layer depending on your adapter, andopentelemetry_ectofor database query spans — each attaches to:telemetryevents your app is likely already emitting. - Automatic resource attribute detection from the OS environment — the SDK reads
OTEL_RESOURCE_ATTRIBUTESby default via its built-in resource detector.
How it works
The Erlang/Elixir SDK is configured through a small amount of Application config rather than only environment variables — this is standard OTel-Erlang practice, still nothing Sophonz-specific:
- In
config/runtime.exs, tell:opentelemetryto batch spans and export them over OTLP (span_processor: :batch,traces_exporter: :otlp). - Add the instrumentation packages for Phoenix, your HTTP adapter, and Ecto — each one attaches to telemetry events on application start (typically in
Application.start/2). - Environment variables handle everything about where telemetry goes and who it belongs to: the collector endpoint, protocol, headers, and resource attributes including
service.key.
CAUTION — Telemetry without a valid service.key is dropped silently
Sophonz's collector runs in enforce mode: it accepts the OTLP payload over the wire but silently drops anything that doesn't carry a resolvable service.key resource attribute. There's no error in your app and no rejected request — the console will simply stay empty. Double-check OTEL_RESOURCE_ATTRIBUTES (and OTEL_EXPORTER_OTLP_HEADERS) before assuming something else is broken.
TIP — Where to next
Head to Installation for the exact mix.exs dependencies, config, environment variable table, and Phoenix/Ecto notes.