Documentation ¶
Overview ¶
Package telemetry defines the agent internal telemetry
Package telemetry provides types and functions for internal telemetry
Index ¶
- func GetCompatComponent() telemetry.Component
- func RegisterStatsSender(sender StatsTelemetrySender)
- type Counter
- type Gauge
- type Histogram
- type Options
- type SimpleCounter
- type SimpleGauge
- type SimpleHistogram
- type StatCounterWrapper
- type StatGaugeWrapper
- type StatsTelemetryProvider
- type StatsTelemetrySender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCompatComponent ¶ added in v0.54.0
GetCompatComponent returns a component wrapping telemetry global variables
func RegisterStatsSender ¶
func RegisterStatsSender(sender StatsTelemetrySender)
RegisterStatsSender regsiters a sender to send the stats metrics
Types ¶
type Counter ¶
type Counter interface { telemetryComponent.Counter }
Counter tracks how many times something is happening.
func NewCounter ¶
NewCounter creates a Counter with default options for telemetry purpose. Current implementation used: Prometheus Counter
type Gauge ¶
type Gauge interface { telemetryComponent.Gauge }
Gauge tracks the value of one health metric of the Agent.
type Histogram ¶
type Histogram interface { telemetryComponent.Histogram }
Histogram tracks the value of one health metric of the Agent.
func NewHistogram ¶
NewHistogram creates a Histogram with default options for telemetry purpose. Current implementation used: Prometheus Histogram
func NewHistogramNoOp ¶
func NewHistogramNoOp() Histogram
NewHistogramNoOp creates a dummy Histogram
type Options ¶
type Options telemetryComponent.Options
Options for telemetry metrics. Creating an Options struct without specifying any of its fields should be the equivalent of using the DefaultOptions var.
var DefaultOptions Options = Options(telemetryComponent.DefaultOptions)
DefaultOptions for telemetry metrics which don't need to specify any option.
type SimpleCounter ¶
type SimpleCounter interface { telemetryComponent.SimpleCounter }
SimpleCounter tracks how many times something is happening.
func NewSimpleCounter ¶
func NewSimpleCounter(subsystem, name, help string) SimpleCounter
NewSimpleCounter creates a new SimpleCounter with default options.
func NewSimpleCounterWithOpts ¶
func NewSimpleCounterWithOpts(subsystem, name, help string, opts Options) SimpleCounter
NewSimpleCounterWithOpts creates a new SimpleCounter.
type SimpleGauge ¶
type SimpleGauge interface { telemetryComponent.SimpleGauge }
SimpleGauge tracks how many times something is happening.
func NewSimpleGauge ¶
func NewSimpleGauge(subsystem, name, help string) SimpleGauge
NewSimpleGauge creates a new SimpleGauge with default options.
func NewSimpleGaugeWithOpts ¶
func NewSimpleGaugeWithOpts(subsystem, name, help string, opts Options) SimpleGauge
NewSimpleGaugeWithOpts creates a new SimpleGauge.
type SimpleHistogram ¶
type SimpleHistogram interface { telemetryComponent.SimpleHistogram }
SimpleHistogram tracks how many times something is happening.
func NewSimpleHistogram ¶
func NewSimpleHistogram(subsystem, name, help string, buckets []float64) SimpleHistogram
NewSimpleHistogram creates a new SimpleHistogram with default options.
func NewSimpleHistogramWithOpts ¶
func NewSimpleHistogramWithOpts(subsystem, name, help string, buckets []float64, opts Options) SimpleHistogram
NewSimpleHistogramWithOpts creates a new SimpleHistogram.
type StatCounterWrapper ¶ added in v0.52.0
type StatCounterWrapper struct {
// contains filtered or unexported fields
}
StatCounterWrapper is a convenience type that allows for migrating telemetry to prometheus Counters while continuing to make the underlying values available for reading
func NewStatCounterWrapper ¶ added in v0.52.0
func NewStatCounterWrapper(subsystem string, statName string, tags []string, description string) *StatCounterWrapper
NewStatCounterWrapper returns a new StatCounterWrapper
func (*StatCounterWrapper) Add ¶ added in v0.52.0
func (sgw *StatCounterWrapper) Add(v int64, tags ...string)
Add adds the given value to the counter with the given tags value.
func (*StatCounterWrapper) Delete ¶ added in v0.52.0
func (sgw *StatCounterWrapper) Delete()
Delete deletes the value for the counter with the given tags value.
func (*StatCounterWrapper) Inc ¶ added in v0.52.0
func (sgw *StatCounterWrapper) Inc(tags ...string)
Inc increments the counter with the given tags value.
func (*StatCounterWrapper) IncWithTags ¶ added in v0.57.0
func (sgw *StatCounterWrapper) IncWithTags(tags map[string]string)
IncWithTags increments the counter with the given tags value.
func (*StatCounterWrapper) Load ¶ added in v0.52.0
func (sgw *StatCounterWrapper) Load() int64
Load atomically loads the wrapped value.
type StatGaugeWrapper ¶ added in v0.52.0
type StatGaugeWrapper struct {
// contains filtered or unexported fields
}
StatGaugeWrapper is a convenience type that allows for migrating telemetry to prometheus Gauges while continuing to make the underlying values available for reading
func NewStatGaugeWrapper ¶ added in v0.52.0
func NewStatGaugeWrapper(subsystem string, statName string, tags []string, description string) *StatGaugeWrapper
NewStatGaugeWrapper returns a new StatGaugeWrapper
func (*StatGaugeWrapper) Add ¶ added in v0.52.0
func (sgw *StatGaugeWrapper) Add(v int64)
Add adds the value to the Gauge value.
func (*StatGaugeWrapper) Dec ¶ added in v0.52.0
func (sgw *StatGaugeWrapper) Dec()
Dec decrements the Gauge value.
func (*StatGaugeWrapper) Inc ¶ added in v0.52.0
func (sgw *StatGaugeWrapper) Inc()
Inc increments the Gauge value.
func (*StatGaugeWrapper) Load ¶ added in v0.52.0
func (sgw *StatGaugeWrapper) Load() int64
Load atomically loads the wrapped value.
func (*StatGaugeWrapper) Set ¶ added in v0.52.0
func (sgw *StatGaugeWrapper) Set(v int64)
Set stores the value for the given tags.
type StatsTelemetryProvider ¶
type StatsTelemetryProvider struct {
// contains filtered or unexported fields
}
StatsTelemetryProvider handles stats telemetry and passes it on to a sender
func GetStatsTelemetryProvider ¶
func GetStatsTelemetryProvider() *StatsTelemetryProvider
GetStatsTelemetryProvider gets an instance of the current stats telemetry provider
func NewStatsTelemetryProvider ¶
func NewStatsTelemetryProvider(sender StatsTelemetrySender) *StatsTelemetryProvider
NewStatsTelemetryProvider creates a new instance of StatsTelemetryProvider
func (*StatsTelemetryProvider) Count ¶
func (s *StatsTelemetryProvider) Count(metric string, value float64, tags []string)
Count reports a count metric to the sender
func (*StatsTelemetryProvider) Gauge ¶
func (s *StatsTelemetryProvider) Gauge(metric string, value float64, tags []string)
Gauge reports a gauge metric to the sender
func (*StatsTelemetryProvider) GaugeNoIndex ¶
func (s *StatsTelemetryProvider) GaugeNoIndex(metric string, value float64, tags []string)
GaugeNoIndex reports a gauge metric not indexed to the sender
type StatsTelemetrySender ¶
type StatsTelemetrySender interface { Count(metric string, value float64, hostname string, tags []string) Gauge(metric string, value float64, hostname string, tags []string) GaugeNoIndex(metric string, value float64, hostname string, tags []string) }
StatsTelemetrySender contains methods needed for sending stats metrics