telemetry

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MPL-2.0 Imports: 23 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 RecordCounterFloat

func RecordCounterFloat(ctx context.Context, meter otelMetric.Meter, metricName string, value float64, attrs ...attribute.KeyValue) error

func RecordCounterInt

func RecordCounterInt(ctx context.Context, meter otelMetric.Meter, metricName string, value int64, attrs ...attribute.KeyValue) error

func RecordGaugeFloat

func RecordGaugeFloat(ctx context.Context, meter otelMetric.Meter, metricName string, value float64, attrs ...attribute.KeyValue) error

func RecordGaugeInt

func RecordGaugeInt(ctx context.Context, meter otelMetric.Meter, metricName string, value int64, attrs ...attribute.KeyValue) error

func RecordHistogramFloat

func RecordHistogramFloat(ctx context.Context, meter otelMetric.Meter, metricName string, value float64, attrs ...attribute.KeyValue) error

func RecordHistogramInt

func RecordHistogramInt(ctx context.Context, meter otelMetric.Meter, metricName string, value int64, attrs ...attribute.KeyValue) error

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
}

func BoolAttribute

func BoolAttribute(key string, value bool) Attrs

func StringAttribute

func StringAttribute(key, value string) Attrs

func StringSliceAttribute

func StringSliceAttribute(key string, value []string) Attrs

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 NewMetricData

func NewMetricData(name string, metricType MetricType, value interface{}, attrs ...Attrs) *MetricData

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