Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Configure ¶
Configure sets the metrics used by packages that emit shared internal metrics. Applications must call Configure with their application namespace before starting those packages.
Calling Configure repeatedly with the same namespace is allowed. Attempting to replace an existing configuration with a different namespace returns an error because metrics may already be registered under the original name.
Types ¶
type Metrics ¶
type Metrics struct {
// PanicsTotal tracks panics recovered by library components.
//
// Labels:
// - "caller": The function or component that recovered the panic
// - "context": Additional context about where the panic occurred
//
// Example usage:
// metrics.RecordPanic("repeat.Every", "background")
PanicsTotal *lazy.CounterVec
}
func Configured ¶
func Configured() *Metrics
Configured returns the application-configured internal metrics. It panics with a setup error when Configure has not been called, preventing ambiguous unnamespaced metrics from being emitted.
func (*Metrics) RecordPanic ¶
RecordPanic records a recovered panic. It is nil-safe so callers do not need conditional metric handling when instrumentation is disabled.