otelecho

package
v0.0.0-...-c713ad7 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package otelecho provides OpenTelemetry instrumentation for Labstack Echo.

This package wraps the upstream OpenTelemetry contrib package (go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho) so that Echo handles an error returned by a handler exactly once. Tracers are resolved from the global OpenTelemetry TracerProvider, and active spans remain in the standard request context.

The upstream package is used directly as a dependency instead of copying the code so this wrapper benefits from upstream updates and fixes.

Note: The upstream package's go.mod contains a replace directive for the b3 propagator, but this is resolved automatically by Go's module system when using the package as a dependency. The replace directive is ignored for dependencies and only affects builds within the upstream repository itself.

Index

Constants

View Source
const (
	// TracerName is name of the tracer
	TracerName = "go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho"

	// TraceIDHeader carries the hex trace id of the server span on every
	// response, so a caller can quote it when reporting a failed request.
	TraceIDHeader = "X-Nico-Trace-Id"
)

Variables

View Source
var (
	WithPropagators    = upstreamotelecho.WithPropagators
	WithTracerProvider = upstreamotelecho.WithTracerProvider
	WithSkipper        = upstreamotelecho.WithSkipper
)

Functions

func Middleware

func Middleware(service string, opts ...upstreamotelecho.Option) echo.MiddlewareFunc

Middleware wraps the upstream otelecho middleware and ensures Echo handles a returned error exactly once.

Types

type Option

type Option = upstreamotelecho.Option

Re-export types and functions from upstream

Jump to

Keyboard shortcuts

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