Documentation
¶
Index ¶
- Variables
- func AddBatchCounters(namedCounts map[string]int64, attrMap map[string]interface{})
- func DecrementGauge(name string)
- func IncrementErrorCounter(name string, err error, attrMap map[string]interface{})
- func IncrementGauge(name string, attrMap map[string]interface{}) error
- func InitObservableGauge(name string, callback func(context.Context) float64) error
- func RecordCounter(name string, value int64, attrMap map[string]interface{})
- func RecordHistogram(name string, value float64, attrMap map[string]interface{})
- func RecordLatency(name string, start time.Time, attrMap map[string]interface{})
- func SetGaugeValue(name string, value int64, attrMap map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ( RecordCounterFunc = RecordCounter RecordHistogramFunc = RecordHistogram IncrementErrorCounterFunc = IncrementErrorCounter IncrementGaugeFunc = IncrementGauge DecrementGaugeFunc = DecrementGauge RecordLatencyFunc = RecordLatency ObservableGaugeFunc = InitObservableGauge ObservableGaugeValueFunc = SetGaugeValue BatchCountersFunc = AddBatchCounters )
Functions ¶
func AddBatchCounters ¶
AddBatchCounters allows batch incrementing of multiple counters by name, sharing the same attribute set for all.
func DecrementGauge ¶
func DecrementGauge(name string)
DecrementGauge subtracts -1 from a named gauge.
func IncrementErrorCounter ¶
IncrementErrorCounter increments a named counter for errors. Automatically attaches error type and message to attributes.
func IncrementGauge ¶
IncrementGauge adds +1 to a named gauge.
func InitObservableGauge ¶
InitObservableGauge registers a gauge that observes values via a callback function. The callback is called automatically during OTEL collection/scrape.
func RecordCounter ¶
RecordCounter increments a named counter metric by a specified value. Automatically initializes and caches the counter instrument.
func RecordHistogram ¶
RecordHistogram records a float64 value to a histogram metric. Useful for tracking things like latencies, sizes, durations, etc.
func RecordLatency ¶
RecordLatency is a convenience function to record latency (in milliseconds) since the provided start time using a histogram.
Types ¶
This section is empty.