telemetry

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMetricInterval = 2

Variables

This section is empty.

Functions

func GetOtelSpanInfoFromContext

func GetOtelSpanInfoFromContext(ctx context.Context) otelSpanInfo

func GetTraceID

func GetTraceID(ctx context.Context) string

func SetError

func SetError(span trace.Span, err error, event string)

Types

type AttributeType

type AttributeType uint
const (
	// INVALID is used for a Value with no value set.
	INVALID AttributeType = iota
	// BOOL is a boolean Type Value.
	BOOL
	// INT64 is a 64-bit signed integral Type Value.
	INT64
	// FLOAT64 is a 64-bit floating point Type Value.
	FLOAT64
	// STRING is a string Type Value.
	STRING
	// BOOLSLICE is a slice of booleans Type Value.
	BOOLSLICE
	// INT64SLICE is a slice of 64-bit signed integral numbers Type Value.
	INT64SLICE
	// FLOAT64SLICE is a slice of 64-bit floating point numbers Type Value.
	FLOAT64SLICE
	// STRINGSLICE is a slice of strings Type Value.
	STRINGSLICE
)

type Attrs

type Attrs struct {
	Key   string
	Value AttrsValue
}

type AttrsValue

type AttrsValue struct {
	Type     AttributeType
	Numberic int64
	Stringly string
	Slice    interface{}
}

type BaseTelemetry

type BaseTelemetry struct {
	// contains filtered or unexported fields
}

func (*BaseTelemetry) Shutdown

func (bt *BaseTelemetry) Shutdown()

type MetricData

type MetricData struct {
	Name       string
	MetricType MetricType
	Value      interface{}
	Attrs      []Attrs
}

func (MetricData) ConvertAttrs

func (md MetricData) ConvertAttrs() []attribute.KeyValue

type MetricType

type MetricType int
const (
	GaugeInt MetricType = iota
	GaugeFloat
	HistogramInt
	HistogramFloat
	CounterInt
	CounterFloat
)

func (MetricType) String

func (mt MetricType) String() string

type OperatorTelemetry

type OperatorTelemetry struct {
	*BaseTelemetry
}

func Init

func Init(ctx context.Context, serviceName, gitTag, gitCommit string, otelEnabled bool, otelHost, otelPort string) (*OperatorTelemetry, error)

func (*OperatorTelemetry) StartMetricCollectors

func (ot *OperatorTelemetry) StartMetricCollectors() error

Jump to

Keyboard shortcuts

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