View Source Tesla.Middleware.OpenTelemetry (opentelemetry_tesla v2.4.0)

Creates OpenTelemetry spans and injects tracing headers into HTTP requests

When used with Tesla.Middleware.PathParams, the span name will be created based on the provided path. Without it, the span name follow OpenTelemetry standards and use just the method name, if not being overridden by opts.

NOTE: This middleware needs to come before Tesla.Middleware.PathParams

Options

  • :span_name - override span name. Can be a String for a static span name, or a function that takes the Tesla.Env and returns a String
  • :propagator - configures trace headers propagators. Setting it to :none disables propagation. Any module that implements :otel_propagator_text_map can be used. Defaults to calling :otel_propagator_text_map.get_text_map_injector/0
  • :mark_status_ok - configures spans with a list of expected HTTP error codes to be marked as ok, not as an error-containing spans

Summary

Functions

Callback implementation for Tesla.Middleware.call/3.