README.md
# opentelemetry_broadway
[](https://github.com/erlef/eef-observability-wg)
[](https://hex.pm/packages/opentelemetry_cowboy)

OpenTelemetry tracing for [Broadway](https://elixir-broadway.org/) pipelines with support for distributed tracing.
## Usage
### Basic Setup
For basic Broadway instrumentation, set up the handler in your application's `Application.start/2` callback:
```elixir
def start(_type, _args) do
OpentelemetryBroadway.setup()
Supervisor.start_link(...)
end
```
### With Trace Propagation
For Broadway pipelines that need distributed tracing with linked spans across services (extracts context from message headers and creates trace links):
```elixir
def start(_type, _args) do
# Enable trace propagation from message headers
OpentelemetryBroadway.setup(propagation: true)
Supervisor.start_link(...)
end
```
## Installation
This library is available on Hex:
```elixir
defp deps do
[
{:opentelemetry_broadway, "~> 0.3"}
]
end
```
## Credit
This repository was [originally created](https://github.com/breakroom/opentelemetry_broadway) by [Tom Taylor](https://github.com/tomtaylor).