Registry / observability / contrib-instrumentation-net-http-otelhttp

contrib-instrumentation-net-http-otelhttp

JSON →
library0.69.0gogounverified

Package otelhttp provides an http.Handler and functions to add OpenTelemetry tracing by wrapping existing HTTP handlers.

go get go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
INSTALL
IMPORT
SIG · CONTRIB-INSTRUMENT
C
contrib-instrumentation-net-http-otelhttp
observabilitygov0.69.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

otelhttp
✓ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp

Wrap an HTTP handler with OpenTelemetry tracing

package main import ( "net/http" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) func main() { handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello, World!")) }) http.Handle("/", otelhttp.NewHandler(handler, "hello")) http.ListenAndServe(":8080", nil) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.69.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
contrib-instrumentation-net-http-otelhttp — go get contrib-instrumentation-net-http-otelhttp · libregistry