telemetry

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CounterAdd

func CounterAdd[T int64](counter DeferrableCounter[T], delta T, options ...metric.AddOption)

func HistogramRecord added in v0.0.8

func HistogramRecord[T int64](histogram DeferrableHistogram[T], delta T, options ...metric.RecordOption)

func SetupOTelSDK added in v0.27.0

func SetupOTelSDK(ctx context.Context, opts ...Option) (shutdown func(context.Context) error, err error)

SetupOTelSDK bootstraps the OpenTelemetry pipeline. If it does not return an error, make sure to call shutdown for proper cleanup.

Types

type DeferrableCounter

type DeferrableCounter[T int64] interface {
	// contains filtered or unexported methods
}

func NewDeferrableInt64Counter

func NewDeferrableInt64Counter(meter metric.Meter, name string, counterOptions []metric.Int64CounterOption, addOptions []metric.AddOption) (DeferrableCounter[int64], error)

type DeferrableHistogram

type DeferrableHistogram[T int64] interface {
	// contains filtered or unexported methods
}

func NewDeferrableHistogram

func NewDeferrableHistogram(meter metric.Meter, name string, histogramOptions []metric.Int64HistogramOption, recordOptions []metric.RecordOption) (DeferrableHistogram[int64], error)

type DeferrableInt64Counter

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

type DeferrableInt64Histogram

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

type Option added in v0.33.0

type Option func(*setupConfig)

Option configures SetupOTelSDK behavior.

func WithHTTPClient added in v0.33.0

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets a custom HTTP client for all OTLP exporters. Takes precedence over WithHeaderProvider.

func WithHeaderProvider added in v0.33.0

func WithHeaderProvider(provider func() map[string]string) Option

WithHeaderProvider sets a function that returns headers to inject into every outbound OTLP HTTP request.

func WithResource added in v0.34.0

func WithResource(r *resource.Resource) Option

WithResource sets an explicit OTel resource to merge with SDK defaults. Caller-provided attributes take precedence on conflict.

Jump to

Keyboard shortcuts

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