opentelemetry_ecto v0.1.0 OpentelemetryEcto View Source

Telemetry handler for creating OpenTelemetry Spans from Ecto query events.

Link to this section Summary

Functions

Attaches the OpentelemetryEcto handler to your repo events. This should be called from your application behaviour on startup.

Link to this section Functions

Link to this function

setup(event_prefix, config \\ [])

View Source

Attaches the OpentelemetryEcto handler to your repo events. This should be called from your application behaviour on startup.

Example:

OpentelemetryEcto.setup([:blog, :repo])

You may also supply the following options in the second argument:

  • :time_unit - a time unit used to convert the values of query phase timings, defaults to :microsecond. See System.convert_time_unit/3

  • :span_prefix - the first part of the span name, as a String.t, defaults to the concatenation of the event name with periods, e.g. "blog.repo.query". This will always be followed with a colon and the source (the table name for SQL adapters).