Documentation
¶
Overview ¶
Package metrics provides OpenTelemetry metrics with cardinality protection. Metrics flow out via OTLP push — there is no scrape endpoint.
Index ¶
Constants ¶
View Source
const MaxLabelCombinations = 1000
MaxLabelCombinations is the cardinality cap per metric.
Variables ¶
View Source
var ( DurationBuckets = []float64{0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 60} ContentBuckets = []float64{100, 500, 1000, 5000, 10000, 50000, 100000, 500000, 1000000} )
Pre-configured histogram buckets.
Functions ¶
This section is empty.
Types ¶
type CounterVec ¶
type CounterVec struct {
// contains filtered or unexported fields
}
CounterVec wraps an OTel Float64Counter with cardinality protection.
type HistogramVec ¶
type HistogramVec struct {
// contains filtered or unexported fields
}
HistogramVec wraps an OTel Float64Histogram with cardinality protection.
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder holds pre-registered metrics for a service.
func New ¶
New creates a Recorder with the given metric prefix and optional logger. The prefix is used as the OTel meter name and prepended to metric names.
func (*Recorder) Counter ¶
func (r *Recorder) Counter(name string) *CounterVec
Counter creates and registers a new counter with the given name.
Click to show internal directories.
Click to hide internal directories.