Documentation ¶
Overview ¶
Package splunkchi provides OpenTelemetry instrumentation for the github.com/go-chi/chi package.
Example ¶
package main import ( "net/http" "github.com/go-chi/chi" "github.com/unionai/splunk-otel-go/instrumentation/github.com/go-chi/chi/splunkchi" ) func main() { router := chi.NewRouter() router.Use(splunkchi.Middleware()) router.Get("/hello", func(w http.ResponseWriter, _ *http.Request) { _, err := w.Write([]byte("Hello World!\n")) if err != nil { w.WriteHeader(http.StatusInternalServerError) } }) if err := http.ListenAndServe(":8080", router); err != nil { panic(err) } }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
Middleware returns github.com/go-chi/chi middleware that traces served requests.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option applies options to a configuration.
func WithAttributes ¶
WithAttributes returns an Option that appends attr to the attributes set for every span created.
func WithPropagator ¶
func WithPropagator(p propagation.TextMapPropagator) Option
WithPropagator returns an Option that sets p as the TextMapPropagator used when propagating a span context.
func WithTracerProvider ¶
func WithTracerProvider(tp trace.TracerProvider) Option
WithTracerProvider returns an Option that sets the TracerProvider used for a configuration.
Click to show internal directories.
Click to hide internal directories.