telemetry

package module
v0.56.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 21

Documentation

Overview

Package telemetry defines the agent internal telemetry

Package telemetry provides types and functions for internal telemetry

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCompatComponent added in v0.54.0

func GetCompatComponent() telemetry.Component

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

func NewCounter(subsystem, name string, tags []string, help string) Counter

NewCounter creates a Counter with default options for telemetry purpose. Current implementation used: Prometheus Counter

func NewCounterWithOpts

func NewCounterWithOpts(subsystem, name string, tags []string, help string, opts Options) Counter

NewCounterWithOpts creates a Counter with the given options for telemetry purpose. See NewCounter()

type Gauge

type Gauge interface {
	telemetryComponent.Gauge
}

Gauge tracks the value of one health metric of the Agent.

func NewGauge

func NewGauge(subsystem, name string, tags []string, help string) Gauge

NewGauge creates a Gauge with default options for telemetry purpose. Current implementation used: Prometheus Gauge

func NewGaugeWithOpts

func NewGaugeWithOpts(subsystem, name string, tags []string, help string, opts Options) Gauge

NewGaugeWithOpts creates a Gauge with the given options for telemetry purpose. See NewGauge()

type Histogram

type Histogram interface {
	telemetryComponent.Histogram
}

Histogram tracks the value of one health metric of the Agent.

func NewHistogram

func NewHistogram(subsystem, name string, tags []string, help string, buckets []float64) Histogram

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

func NewHistogramWithOpts

func NewHistogramWithOpts(subsystem, name string, tags []string, help string, buckets []float64, opts Options) Histogram

NewHistogramWithOpts creates a Histogram with the given options for telemetry purpose. See NewHistogram()

type Options

Options for telemetry metrics. Creating an Options struct without specifying any of its fields should be the equivalent of using the DefaultOptions var.

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) 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL