telemetry

package
v0.0.0-...-a984536 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	LogTrace(typeTrace string, message string)
	LogInfo(typeInfo string, message string)
	LogWarning(typeWarning string, message string)
	LogError(message string, err error)
	LogDuration(duration float64)
	LogTraceByInstance(typeTrace string, message string, instance string)
	LogInfoByInstance(typeInfo string, message string, instance string)
	LogWarningByInstance(typeWarning string, message string, instance string)
	LogErrorByInstance(message string, err error, instance string)
	CreateHistogram(name string, start float64, width float64, numberOfBuckets int) (histogram prometheus.Histogram)
}

Client contains the functions for Telemetry

type Telemetry

type Telemetry struct {
	NamespaceName string
	SubsystemName string
	ComponentName string
	Logger        *logr.Logger
}

Telemetry contains data for the Client

func InitializeTelemetryDefault

func InitializeTelemetryDefault(componentName string) *Telemetry

InitializeTelemetryDefault initializes a TelemetryFactory client

func (*Telemetry) CreateHistogram

func (t *Telemetry) CreateHistogram(name string, start float64, width float64, numberOfBuckets int) (histogram prometheus.Histogram)

CreateHistogram creates a histogram, start = what value the historgram starts at, width = how wide are the buckets, numberOfBuckets = the number of buckets in the histogram

func (*Telemetry) LogDuration

func (t *Telemetry) LogDuration(durationInSecs float64)

LogDuration logs the duration of an operation in seconds

func (*Telemetry) LogError

func (t *Telemetry) LogError(message string, err error)

LogError logs an error

func (*Telemetry) LogErrorByInstance

func (t *Telemetry) LogErrorByInstance(message string, err error, instance string)

LogErrorByInstance logs an error

func (*Telemetry) LogInfo

func (t *Telemetry) LogInfo(typeInfo string, message string)

LogInfo logs an informational message

func (*Telemetry) LogInfoByInstance

func (t *Telemetry) LogInfoByInstance(typeInfo string, message string, instance string)

LogInfoByInstance logs an informational message

func (*Telemetry) LogTrace

func (t *Telemetry) LogTrace(typeTrace string, message string)

LogTrace logs a trace message, it does not send telemetry to Prometheus

func (*Telemetry) LogTraceByInstance

func (t *Telemetry) LogTraceByInstance(typeTrace string, message string, instance string)

LogTraceByInstance logs a trace

func (*Telemetry) LogWarning

func (t *Telemetry) LogWarning(typeWarning string, message string)

LogWarning logs a warning

func (*Telemetry) LogWarningByInstance

func (t *Telemetry) LogWarningByInstance(typeWarning string, message string, instance string)

LogWarningByInstance logs a warning

Jump to

Keyboard shortcuts

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