telemetry

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

View Source
const LevelLoggingDisabled slog.Level = 100

LevelLoggingDisabled sets the slog log level for LoggingDisabled string constant

View Source
const LoggingDisabled = "DISABLED"

LoggingDisabled holds a value to use when logging should be globally disabled, without removing the log handler

View Source
const (
	// MetricsClientContextKey sets the context key for the metrics client
	MetricsClientContextKey contextKey = "metrics"
)

Variables

This section is empty.

Functions

func ConfigureLogger

func ConfigureLogger(ctx context.Context, globalTags map[string]string, logLevel string) (*slog.Logger, error)

func Gauge

func Gauge(metrics *statsd.Client, name string, value float64, tags map[string]string, rate float64)

Gauge reports a GAUGE metric using best-effort approach

func GaugeDuration

func GaugeDuration(metrics *statsd.Client, name string, startedAt time.Time, tags map[string]string, rate float64)

GaugeDuration reports a GAUGE metric corresponding to a duration of an operation that started at a specified time, in milliseconds

func GetClient added in v1.2.3

func GetClient(ctx context.Context) *statsd.Client

GetClient returns an initialized statsd client, if it exists

func Increment added in v0.3.0

func Increment(metrics *statsd.Client, name string, tags map[string]string)

Increment reports COUNT metric with a value of 1

func WithStatsd

func WithStatsd(ctx context.Context, metricsNamespace string) context.Context

WithStatsd enriches the context with a statsd client if it can be instantiated

Types

type DatadogLoggerConfiguration

type DatadogLoggerConfiguration struct {
	Endpoint    string
	ApiKey      string
	Hostname    string
	ServiceName string
}

func NewDatadogLoggerConfiguration

func NewDatadogLoggerConfiguration() (*DatadogLoggerConfiguration, error)

Jump to

Keyboard shortcuts

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