opentelemetry-erlang-contrib/instrumentation/opentelemetry_tesla
Ricardo Paiva e8d1462f46
Add otel tesla library (#90)
* Add Tesla HTTP client instrumentation library

* Update workflows configuration

* Update labeler.yml

* Update CODEOWNERS

* Add LICENSE file

Co-authored-by: Bryan Naegele <bryannaegele@users.noreply.github.com>
2022-08-25 12:47:59 -06:00
..
lib/middleware Add otel tesla library (#90) 2022-08-25 12:47:59 -06:00
test Add otel tesla library (#90) 2022-08-25 12:47:59 -06:00
LICENSE Add otel tesla library (#90) 2022-08-25 12:47:59 -06:00
README.md Add otel tesla library (#90) 2022-08-25 12:47:59 -06:00
mix.exs Add otel tesla library (#90) 2022-08-25 12:47:59 -06:00
mix.lock Add otel tesla library (#90) 2022-08-25 12:47:59 -06:00

README.md

OpenTelemetryTesla

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

Installation

If available in Hex, the package can be installed by adding opentelemetry_tesla to your list of dependencies in mix.exs:

def deps do
  [
    {:opentelemetry_tesla, "~> 2.0.1"}
  ]
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