observability

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime exposes OpenTelemetry HTTP wrappers and gateway metric hooks.

func Setup

func Setup(ctx context.Context, cfg config.OTelConfig, serviceVersion string, logger *slog.Logger) (*Runtime, error)

Setup initializes OpenTelemetry providers and runtime hooks.

func (*Runtime) Enabled

func (r *Runtime) Enabled() bool

Enabled reports whether OpenTelemetry instrumentation is active.

func (*Runtime) RecordTraceQueueDrop

func (r *Runtime) RecordTraceQueueDrop(path string, status int)

RecordTraceQueueDrop increments a counter when the async trace queue is full.

func (*Runtime) RecordTraceWriteFailure

func (r *Runtime) RecordTraceWriteFailure(operation string, failedCount int)

RecordTraceWriteFailure increments a counter for dropped trace records.

func (*Runtime) Shutdown

func (r *Runtime) Shutdown(ctx context.Context) error

Shutdown flushes and stops OpenTelemetry providers.

func (*Runtime) SpanEnrichmentMiddleware

func (r *Runtime) SpanEnrichmentMiddleware(next http.Handler) http.Handler

SpanEnrichmentMiddleware adds gateway attributes and stable error status on 5xx responses.

func (*Runtime) WrapHTTPHandler

func (r *Runtime) WrapHTTPHandler(next http.Handler) http.Handler

WrapHTTPHandler wraps an inbound HTTP handler with OpenTelemetry spans.

func (*Runtime) WrapHTTPTransport

func (r *Runtime) WrapHTTPTransport(base http.RoundTripper) http.RoundTripper

WrapHTTPTransport wraps an outbound HTTP transport with OpenTelemetry spans.

Jump to

Keyboard shortcuts

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