otel

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Bool = iota
	String
	Int
	Float
)

Type helper

View Source
const (
	EventName                 = "feature_flag"
	EventPropertyFlagKey      = "feature_flag.key"
	EventPropertyProviderName = "feature_flag.provider_name"
	EventPropertyVariant      = "feature_flag.variant"
)

Variables

This section is empty.

Functions

func NewTracesHook added in v0.2.5

func NewTracesHook(opts ...Options) *traceHook

NewTracesHook return a reference to a new instance of the OpenTelemetry Hook

Types

type DimensionDescription added in v0.2.5

type DimensionDescription struct {
	Key string
	Type
}

DimensionDescription is key and Type description of the dimension

type MetricOptions added in v0.2.5

type MetricOptions func(*MetricsHook)

func WithFlagMetadataDimensions added in v0.2.5

func WithFlagMetadataDimensions(descriptions ...DimensionDescription) MetricOptions

WithFlagMetadataDimensions allows configuring extra dimensions for feature_flag.evaluation_success_total metric. If provided, dimensions will be extracted from openfeature.FlagMetadata & added to the metric with the same key

func WithMetricsAttributeSetter added in v0.3.0

func WithMetricsAttributeSetter(callback func(openfeature.FlagMetadata) []attribute.KeyValue) MetricOptions

WithMetricsAttributeSetter allows to set a extractionCallback which accept openfeature.FlagMetadata and returns []attribute.KeyValue derived from those metadata.

type MetricsHook added in v0.2.5

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

func NewMetricsHookForProvider added in v0.2.7

func NewMetricsHookForProvider(provider *metric.MeterProvider, opts ...MetricOptions) (*MetricsHook, error)

NewMetricsHookForProvider builds a metric hook backed by metric.MeterProvider.

func (*MetricsHook) After added in v0.2.5

func (*MetricsHook) Before added in v0.2.5

func (*MetricsHook) Error added in v0.2.5

func (*MetricsHook) Finally added in v0.2.5

type Options added in v0.2.5

type Options func(*traceHook)

func WithErrorStatusEnabled added in v0.2.5

func WithErrorStatusEnabled() Options

WithErrorStatusEnabled enable setting span status to codes.Error in case of an error. Default behavior is disabled

func WithTracesAttributeSetter added in v0.3.0

func WithTracesAttributeSetter(callback func(openfeature.FlagMetadata) []attribute.KeyValue) Options

WithTracesAttributeSetter allows to set a extractionCallback which accept openfeature.FlagMetadata and returns []attribute.KeyValue derived from those metadata. If present, returned attributes will be added to successful evaluation traces

type Type added in v0.2.5

type Type int

Jump to

Keyboard shortcuts

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