Documentation ¶
Overview ¶
Package otelfiber instruments the github.com/gofiber/fiber package. (https://github.com/gofiber/fiber).
Currently, only the routing of a received message can be instrumented. To do so, use the Middleware function.
Index ¶
- Constants
- func Middleware(opts ...Option) fiber.Handler
- type Option
- func WithMeterProvider(provider otelmetric.MeterProvider) Option
- func WithPort(port int) Option
- func WithPropagators(propagators propagation.TextMapPropagator) Option
- func WithServerName(serverName string) Option
- func WithSkipURIs(uris []string) Option
- func WithSpanNameFormatter(f func(ctx *fiber.Ctx) string) Option
- func WithTracerProvider(provider oteltrace.TracerProvider) Option
Constants ¶
const ( // Unit constants for deprecated metric units UnitDimensionless = "1" UnitBytes = "By" UnitMilliseconds = "ms" )
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(opts ...Option) fiber.Handler
Middleware returns fiber handler which will trace incoming requests.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option specifies instrumentation configuration options.
func WithMeterProvider ¶
func WithMeterProvider(provider otelmetric.MeterProvider) Option
WithMeterProvider specifies a meter provider to use for reporting. If none is specified, the global provider is used.
func WithPort ¶
WithPort specifies the value to use when setting the `net.host.port` attribute on metrics/spans. Attribute is "Conditionally Required: If not default (`80` for `http`, `443` for `https`).
func WithPropagators ¶
func WithPropagators(propagators propagation.TextMapPropagator) Option
WithPropagators specifies propagators to use for extracting information from the HTTP requests. If none are specified, global ones will be used.
func WithServerName ¶
WithServerName specifies the value to use when setting the `http.server_name` attribute on metrics/spans.
func WithSkipURIs ¶
WithSkipURIs specifies the uris to exclude
func WithSpanNameFormatter ¶
WithSpanNameFormatter takes a function that will be called on every request and the returned string will become the Span Name
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.