Documentation
¶
Overview ¶
Package telemetry provides utilities for extracting data from the OpenFeature SDK for use in telemetry signals.
Index ¶
Constants ¶
const ( FlagKey string = "feature_flag.key" ErrorTypeKey string = "error.type" ResultValueKey string = "feature_flag.result.value" ResultVariantKey string = "feature_flag.result.variant" ErrorMessageKey string = "error.message" ContextIDKey string = "feature_flag.context.id" ProviderNameKey string = "feature_flag.provider.name" ResultReasonKey string = "feature_flag.result.reason" FlagSetIDKey string = "feature_flag.set.id" VersionKey string = "feature_flag.version" )
The OpenTelemetry compliant event attributes for flag evaluation.
const FlagEvaluationKey string = "feature_flag.evaluation"
FlagEvaluationKey is the name of the feature flag evaluation event.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvaluationEvent ¶
type EvaluationEvent struct {
// Name is the name of the event.
// It is always "feature_flag.evaluation".
Name string
// Attributes represents the event's attributes.
Attributes map[string]any
}
EvaluationEvent represents an event that is emitted when a flag is evaluated. It is intended to be used to record flag evaluation events as OpenTelemetry log records. See the OpenFeature specification Appendix D: Observability and the OpenTelemetry Semantic conventions for feature flags in logs for more information.
func CreateEvaluationEvent ¶
func CreateEvaluationEvent(hookContext openfeature.HookContext, details openfeature.InterfaceEvaluationDetails) EvaluationEvent
CreateEvaluationEvent creates an EvaluationEvent. It is intended to be used in the `Finally` stage of a openfeature.Hook.