http4s-otel4s-middleware

http4s-otel4s-middleware

OpenTelemetry metrics and tracing for http4s clients and servers, built on otel4s. Record spans and metrics for streaming requests and responses. Request and response body effects keep the HTTP context, even when they run later.

Start here

  1. Getting started: add dependencies and send your first request.
  2. Client instrumentation or Server instrumentation: wrap your client or app.
  3. Streaming lifecycle: learn when requests finish and where to place the middleware.

Choose a module

Need Artifact suffix Entry point
Client metrics and tracing client ClientInstrumentation
Server metrics and tracing server ServerInstrumentation
Client metrics only metrics-client ClientMetrics
Server metrics only metrics-server ServerMetrics
Client tracing only trace-client ClientMiddleware
Server tracing only trace-server ServerMiddleware

All artifact names start with http4s-otel4s-middleware-. Scala 2.13 and Scala 3 are supported on JVM, Scala.js and Scala Native. Choose a telemetry backend that supports your platform. The OtelJava example in this guide runs on the JVM.

Explore

Source and API reference: GitHub ยท API reference.