Documentation ¶
Overview ¶
Package telemetry defines the agent internal telemetry
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultOptions = Options{ NoDoubleUnderscoreSep: false, }
DefaultOptions for telemetry metrics which don't need to specify any option.
Functions ¶
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 struct { // NoDoubleUnderscoreSep is set to true when you don't want to // separate the subsystem and the name with a double underscore separator. NoDoubleUnderscoreSep bool }
Options for telemetry metrics. Creating an Options struct without specifying any of its fields should be the equivalent of using the DefaultOptions var.
func (*Options) NameWithSeparator ¶
NameWithSeparator returns name prefixed according to NoDoubleUnderscoreOption.
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 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