otel

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ScopeName is the instrumentation scope name.
	ScopeName = "github.com/ingka-group/fastecho/"
)

Variables

This section is empty.

Functions

func GetHttpRequestAttributes

func GetHttpRequestAttributes(c echo.Context, req *http.Request, config *TracerConfig) []attribute.KeyValue

func HTTPServerStatus

func HTTPServerStatus(code int) (codes.Code, string)

func Middleware

func Middleware(options ...Option) echo.MiddlewareFunc

Middleware returns echo middleware which will trace incoming requests.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithEnv

func WithEnv(env string) Option

WithEnv specifies the environment for filtering the spans

func WithPropagators

func WithPropagators(propagators propagation.TextMapPropagator) Option

func WithServiceName

func WithServiceName(serviceName string) Option

WithServiceName specifies the name of the service

func WithSkipper

func WithSkipper(skipper middleware.Skipper) Option

WithSkipper specifies a skipper for allowing requests to skip generating spans.

func WithTracerProvider

func WithTracerProvider(provider oteltrace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.

type TracerConfig

type TracerConfig struct {
	TracerProvider oteltrace.TracerProvider
	Propagators    propagation.TextMapPropagator
	Skipper        middleware.Skipper
	ServiceName    string
	Env            string
}

Jump to

Keyboard shortcuts

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