monitoring

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MsBuckets = []float64{
	0.0005, 0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0,
}

MsBuckets provides histogram boundaries for millisecond-scale measurements (500us to 5s) in seconds.

View Source
var SBuckets = []float64{
	0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 30.0, 60.0, 120.0,
}

SBuckets provides histogram boundaries for second-scale measurements (5ms to 2m) in seconds.

View Source
var UsBuckets = []float64{
	0.000001, 0.000002, 0.000005, 0.00001, 0.00002, 0.00005,
	0.0001, 0.0002, 0.0005, 0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1,
}

UsBuckets provides histogram boundaries for microsecond-scale measurements (1us to 100ms) in seconds.

Functions

func WithAttributes

func WithAttributes(attrs ...attribute.KeyValue) metric.RecordOption

WithAttributes is a wrapper around metric.WithAttributes to satisfy linter rules.

Types

type MetricsSetup

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

MetricsSetup encapsulates metrics configuration and lifecycle.

func SetupMetrics

func SetupMetrics(
	ctx context.Context,
	enabled bool,
	otelEndpoint string,
	exportInterval time.Duration,
	insecure bool,
	serviceName, serviceVersion string,
) (*MetricsSetup, error)

SetupMetrics initializes OTel metrics if enabled. If disabled, does nothing - OTel will use its built-in noop provider.

func (*MetricsSetup) Shutdown

func (m *MetricsSetup) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the metrics provider.

Jump to

Keyboard shortcuts

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