otel

package
v4.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WithInternalPathFilter = otelhttp.WithFilter(
	filters.None(
		filters.Path("/metrics"),
		filters.Path("/health"),
	),
)

WithInternalPathFilter is the default tracing filter passed to the Middleware. It filters out /metrics and /health requests.

Functions

func Middleware

func Middleware(name string, opts ...otelhttp.Option) func(next http.Handler) http.Handler

Middleware configures the otelhttp.NewHandler and returns a middleware is compatible with the chi router interface.

Example:

r := chi.NewRouter()
r.Use(otel.Middleware("Server"))

The most common options to pass will be the otelhttp.WithFilter and otelhttp.WithSpanNameFormatter

When no options are passed a default filter for /metrics and /health is used.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL