telemetry

package
v0.0.0-...-ee04f8c Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CLIFlagDebug = &cli.BoolFlag{
	Name:    "debug",
	Usage:   "Enable debug mode",
	Value:   false,
	EnvVars: []string{"DEBUG"},
}
View Source
var CLIFlagMetricsListenAddress = &cli.StringFlag{
	Name:    "metrics-listen-address",
	Usage:   "listen endpoint for metrics and pprof",
	Value:   "0.0.0.0:8081",
	EnvVars: []string{"METRICS_LISTEN_ADDRESS"},
}

Functions

func StartLogger

func StartLogger(cctx *cli.Context, opts ...LoggingOption) *slog.Logger

func StartMetrics

func StartMetrics(cctx *cli.Context, opts ...MetricsOption)

Types

type Logging

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

type LoggingOption

type LoggingOption func(*Logging)

LoggingOption is a functional option for configuring the Logger.

func WithHandler

func WithHandler(handler slog.Handler) LoggingOption

WithHandler sets a custom slog.Handler for the logger.

func WithLevel

func WithLevel(level slog.Level) LoggingOption

WithLevel sets the logging level for the logger. Defaults to slog.LevelInfo or slog.LevelDebug if debug is enabled.

func WithSource

func WithSource(includeSource bool) LoggingOption

WithSource sets whether the logger should include source information. Defaults to true.

type Metrics

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

type MetricsOption

type MetricsOption func(*Metrics)

MetricsOption is a functional option for configuring the Metrics.

func WithListenAddr

func WithListenAddr(addr string) MetricsOption

WithListenAddr sets the listen address for the metrics server. Defaults to :8081 or whatever is set in the CLI flag.

func WithPath

func WithPath(path string) MetricsOption

WithPath sets the path for the metrics server. Defaults to "/metrics".

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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