opentelemetry-erlang-contrib/instrumentation/opentelemetry_tesla
renovate[bot] d22ce7ba8e
Update dependency opentelemetry_telemetry to ~> 1.1.0 (#271)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-05 10:34:51 -07:00
..
lib/middleware Fixup doc version and typo (#211) 2023-10-03 07:39:45 -06:00
test Improve test matrix and add support for Elixir 1.15 and OTP 26 (#188) 2023-08-25 14:11:23 -06:00
.formatter.exs Fix CI errors, update GHA deps, update versions (#125) 2022-11-15 16:22:28 -07:00
LICENSE Add otel tesla library (#90) 2022-08-25 12:47:59 -06:00
README.md Fixup doc version and typo (#211) 2023-10-03 07:39:45 -06:00
mix.exs Update dependency opentelemetry_telemetry to ~> 1.1.0 (#271) 2024-02-05 10:34:51 -07:00
mix.lock Update dependency opentelemetry_telemetry to ~> 1.1.0 (#271) 2024-02-05 10:34:51 -07:00

README.md

OpenTelemetryTesla

Tesla middleware that creates OpenTelemetry spans and injects tracing headers into HTTP requests for Tesla clients.

Installation

The package is available in Hex and can be installed by adding opentelemetry_tesla to your list of dependencies in mix.exs:

def deps do
  [
    {:opentelemetry_tesla, "~> 2.2.0"}
  ]
end

Setup

Whilst using this middleware is as simple as adding it to your Tesla middlewares configuration, It's very important to set the correct order of the middlewares

The is crucial to correctly get the parameterized version of the URL, something like /api/users/:id instead of /api/users/3.

OpenTelemetry comes first, PathParams (if you're using it) comes after.

Tesla.Middleware.OpenTelemetry
Tesla.Middleware.PathParams