Telemetry handler that creates OpenTelemetry spans from Commanded commands and events.
OpentelemetryCommanded currently creates spans for:
- Application Dispatch
- Aggregate Execute
- Event.Handler Handle
- ProcessManager Handle
- EventStore
append_to_stream
andstream_forward
If available in Hex, the package can be installed
by adding opentelemetry_commanded
to your list of dependencies in mix.exs
:
def deps do
[
{:opentelemetry_commanded, "~> 0.1.0"}
]
end
Once installed, execute the following function in your application behaviour before your top-level supervisor starts.
# lib/my_app/application.ex
OpentelemetryCommanded.setup()
Then add the OpentelemetryCommanded.Middleware
to your Commanded
routers
middleware OpentelemetryCommanded.Middleware