otel_http library
OpenTelemetry instrumentation for package:http.
See OTelHttpClient for usage.
Classes
- OTelHttpClient
-
OpenTelemetry instrumentation for
package:http.
Functions
-
httpInstrumentationSuppressed(
) → bool -
Returns
truewhen the current zone has opted out of HTTP OTel instrumentation. -
httpRequestInstrumented(
) → bool -
Returns
truewhile the current zone is sending a request that OTelHttpClient instruments. -
runAsInstrumentedHttp<
T> (Future< T> body()) → Future<T> -
Runs
bodymarked as instrumented: see httpRequestInstrumented. OTelHttpClient sends every request this way; a hand-written instrumented client can do the same. -
runWithoutHttpInstrumentation<
T> (T body()) → T -
Runs
bodyin a zone where OTelHttpClient.send will skip span creation and header injection. -
runWithoutHttpInstrumentationAsync<
T> (Future< T> body()) → Future<T> - Async variant of runWithoutHttpInstrumentation. Both forms are safe to nest; they no-op once already inside a suppressed zone.