telemetry

package
v0.0.0-...-dca2ff9 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

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 Handler

func Handler() http.Handler

Handler serves the HTTP route containing the prometheus metrics.

func IsCheckEnabled

func IsCheckEnabled(checkName string) bool

IsCheckEnabled returns if we want telemetry for the given check. Returns true if a * is present in the telemetry.checks list.

func IsEnabled

func IsEnabled() bool

IsEnabled returns whether or not telemetry is enabled

Types

type Counter

type Counter interface {
	// Inc increments the counter for the given tags.
	Inc(tagsValue ...string)
	// Add adds the given value to the counter for the given tags.
	Add(value float64, tagsValue ...string)
	// Delete deletes the value for the counter with the given tags.
	Delete(tagsValue ...string)
}

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 {
	// Set stores the value for the given tags.
	Set(value float64, tagsValue ...string)
	// Inc increments the Gauge value.
	Inc(tagsValue ...string)
	// Dec decrements the Gauge value.
	Dec(tagsValue ...string)
	// Add adds the value to the Gauge value.
	Add(value float64, tagsValue ...string)
	// Sub subtracts the value to the Gauge value.
	Sub(value float64, tagsValue ...string)
	// Delete deletes the value for the Gauge with the given tags.
	Delete(tagsValue ...string)
}

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

Jump to

Keyboard shortcuts

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