telemetry

package
v0.0.0-...-6806e21 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Telemetry

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

Telemetry contains data for the TelemetryClient

func InitializeTelemetryDefault

func InitializeTelemetryDefault(componentName string, logger logr.Logger) *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

type TelemetryClient

type TelemetryClient 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)
}

TelemetryClient contains the functions for Telemetry

Jump to

Keyboard shortcuts

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