backwork (Elixir)

One-call OpenTelemetry tracing for backwork.dev. Wraps the opentelemetry_* exporter config and instrumentation setup so you don't hand-wire raw OTel.

Logs and host/container metrics come from the backwork agent (curl … install.sh). This package is only for distributed traces / APM from inside your app.

Install

In mix.exs, add :backwork plus the instrumentation libs your app uses:

def deps do
[
{:backwork, "~> 0.1"},
{:opentelemetry_phoenix, "~> 2.0"}, # if Phoenix
{:opentelemetry_bandit, "~> 0.2"}, # or :opentelemetry_cowboy
{:opentelemetry_ecto, "~> 1.2"} # if Ecto
]
end

Use

  1. Create a Project in backwork and copy its ingest token; set BACKWORK_TOKEN.
  2. Configure the exporter in config/runtime.exs:
config :opentelemetry, traces_exporter: :otlp
config :opentelemetry_exporter, Backwork.exporter_config()
  1. Attach instrumentation in application.ex, before your supervisor children:
def start(_type, _args) do
Backwork.setup(phoenix_adapter: :bandit, ecto: [[:my_app, :repo]])
children = [...]
Supervisor.start_link(children, strategy: :one_for_one, name: MyApp.Supervisor)
end

Name the service with OTEL_RESOURCE_ATTRIBUTES=service.name=my-app.

Config

EnvDefaultNotes
BACKWORK_TOKENrequired — project ingest token
BACKWORK_ENDPOINThttps://backwork.dev/otlpself-hosted? point at your own host

Within ~30s of the first request your service appears under Traces, Requests and Metrics → Application performance.