configtelemetry

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flags

func Flags(flags *flag.FlagSet)

Flags is a helper func, to add the telemetry config flags to the service that exposes the application flags.

Types

type Level

type Level int8

Level is the level of internal telemetry (metrics, logs, traces about the component itself) that every component should generate.

const (
	// LevelNone indicates that no telemetry data should be collected.
	LevelNone Level = iota - 1
	// LevelBasic is the recommended and covers the basics of the service telemetry.
	LevelBasic
	// LevelNormal adds some other indicators on top of basic.
	LevelNormal
	// LevelDetailed adds dimensions and views to the previous levels.
	LevelDetailed
)

func GetMetricsLevelFlagValue

func GetMetricsLevelFlagValue() Level

GetMetricsLevelFlagValue returns the value of the "--metrics-level" flag. IMPORTANT: This must be used only in the core collector code for the moment.

func (*Level) Set

func (l *Level) Set(s string) error

func (*Level) String

func (l *Level) String() string

type TelemetrySetting

type TelemetrySetting struct {
	// MetricsLevelStr is the level of telemetry metrics, the possible values are:
	//  - "none" indicates that no telemetry data should be collected;
	//  - "basic" is the recommended and covers the basics of the service telemetry.
	//  - "normal" adds some other indicators on top of basic.
	//  - "detailed" adds dimensions and views to the previous levels.
	MetricsLevelStr string `mapstructure:"metrics_level"`
}

TelemetrySetting exposes the common Telemetry configuration for one component.

func DefaultTelemetrySetting

func DefaultTelemetrySetting() TelemetrySetting

DefaultTelemetrySetting returns the default TelemetrySetting. The level is set to the "--metrics-level" flag if set, otherwise the default "basic" level.

func (TelemetrySetting) GetMetricsLevel

func (ts TelemetrySetting) GetMetricsLevel() (Level, error)

GetMetricsLevel returns the parsed level, or error if unknown value. Empty string is consider unknown value.

Jump to

Keyboard shortcuts

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