telemetry

package module
v0.50.3-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 21

Documentation

Overview

Package telemetry defines the agent internal telemetry

Index

Constants

This section is empty.

Variables

View Source
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

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

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

func (opts *Options) NameWithSeparator(subsystem, name string) string

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

Jump to

Keyboard shortcuts

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