Documentation ¶
Index ¶
- Constants
- func NewTracesHook(opts ...Options) *traceHook
- type DimensionDescription
- type MetricOptions
- type MetricsHook
- func (h *MetricsHook) After(ctx context.Context, hCtx openfeature.HookContext, ...) error
- func (h *MetricsHook) Before(ctx context.Context, hCtx openfeature.HookContext, hint openfeature.HookHints) (*openfeature.EvaluationContext, error)
- func (h *MetricsHook) Error(ctx context.Context, hCtx openfeature.HookContext, err error, ...)
- func (h *MetricsHook) Finally(ctx context.Context, hCtx openfeature.HookContext, hint openfeature.HookHints)
- type Options
- type Type
Constants ¶
const ( Bool = iota String Int Float )
Type helper
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
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 (h *MetricsHook) After(ctx context.Context, hCtx openfeature.HookContext, details openfeature.InterfaceEvaluationDetails, hint openfeature.HookHints) error
func (*MetricsHook) Before ¶ added in v0.2.5
func (h *MetricsHook) Before(ctx context.Context, hCtx openfeature.HookContext, hint openfeature.HookHints) (*openfeature.EvaluationContext, error)
func (*MetricsHook) Error ¶ added in v0.2.5
func (h *MetricsHook) Error(ctx context.Context, hCtx openfeature.HookContext, err error, hint openfeature.HookHints)
func (*MetricsHook) Finally ¶ added in v0.2.5
func (h *MetricsHook) Finally(ctx context.Context, hCtx openfeature.HookContext, hint openfeature.HookHints)
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