@@ -76,8 +76,8 @@ func NewMetricsHookForProvider(provider api.MeterProvider, opts ...MetricOptions
76
76
}
77
77
78
78
func (h * MetricsHook ) Before (ctx context.Context , hCtx openfeature.HookContext ,
79
- hint openfeature.HookHints ) ( * openfeature. EvaluationContext , error ) {
80
-
79
+ hint openfeature.HookHints ,
80
+ ) ( * openfeature. EvaluationContext , error ) {
81
81
h .activeCounter .Add (ctx , + 1 , api .WithAttributes (semconv .FeatureFlagKey (hCtx .FlagKey ())))
82
82
83
83
h .requestCounter .Add (ctx , 1 ,
@@ -89,11 +89,12 @@ func (h *MetricsHook) Before(ctx context.Context, hCtx openfeature.HookContext,
89
89
}
90
90
91
91
func (h * MetricsHook ) After (ctx context.Context , hCtx openfeature.HookContext ,
92
- details openfeature.InterfaceEvaluationDetails , hint openfeature.HookHints ) error {
93
-
92
+ details openfeature.InterfaceEvaluationDetails , hint openfeature.HookHints ,
93
+ ) error {
94
94
attribs := []attribute.KeyValue {
95
95
semconv .FeatureFlagKey (hCtx .FlagKey ()),
96
- semconv .FeatureFlagProviderName (hCtx .ProviderMetadata ().Name )}
96
+ semconv .FeatureFlagProviderName (hCtx .ProviderMetadata ().Name ),
97
+ }
97
98
98
99
if details .Variant != "" {
99
100
attribs = append (attribs , semconv .FeatureFlagVariant (details .Variant ))
@@ -122,7 +123,7 @@ func (h *MetricsHook) Error(ctx context.Context, hCtx openfeature.HookContext, e
122
123
attribute .String (semconv .ExceptionEventName , err .Error ())))
123
124
}
124
125
125
- func (h * MetricsHook ) Finally (ctx context.Context , hCtx openfeature.HookContext , hint openfeature.HookHints ) {
126
+ func (h * MetricsHook ) Finally (ctx context.Context , hCtx openfeature.HookContext , flagEvaluationDetails openfeature. InterfaceEvaluationDetails , hint openfeature.HookHints ) {
126
127
h .activeCounter .Add (ctx , - 1 , api .WithAttributes (semconv .FeatureFlagKey (hCtx .FlagKey ())))
127
128
}
128
129
@@ -167,7 +168,6 @@ func WithMetricsAttributeSetter(callback func(openfeature.FlagMetadata) []attrib
167
168
// descriptionsToAttributes is a helper to extract dimensions from openfeature.FlagMetadata. Missing metadata
168
169
// dimensions are ignore.
169
170
func descriptionsToAttributes (metadata openfeature.FlagMetadata , descriptions []DimensionDescription ) []attribute.KeyValue {
170
-
171
171
attribs := []attribute.KeyValue {}
172
172
for _ , dimension := range descriptions {
173
173
switch dimension .Type {
0 commit comments