tracing

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: EUPL-1.2 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient() *http.Client

NewHTTPClient creates an http.Client with OpenTelemetry instrumentation. This wrapper centralizes tracing configuration for outbound HTTP calls, allowing future additions like custom options or sampling without changing callers.

func WrapTransport

func WrapTransport(transport http.RoundTripper) http.RoundTripper

WrapTransport wraps an http.RoundTripper with OpenTelemetry instrumentation. If transport is nil, http.DefaultTransport is used. This wrapper centralizes tracing configuration for outbound HTTP calls, allowing future additions like custom options or sampling without changing callers.

Types

type Component

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

func New

func New(cfg Config) *Component

func (*Component) RegisterHttpHandlers

func (c *Component) RegisterHttpHandlers(publicMux *http.ServeMux, internalMux *http.ServeMux)

func (*Component) Start

func (c *Component) Start() error

func (*Component) Stop

func (c *Component) Stop(ctx context.Context) error

type Config

type Config struct {
	OTLPEndpoint   string `koanf:"otlpendpoint"`
	Insecure       bool   `koanf:"insecure"`
	ServiceName    string `koanf:"servicename"`
	ServiceVersion string
}

func DefaultConfig

func DefaultConfig() Config

Jump to

Keyboard shortcuts

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