@@ -76,8 +76,8 @@ func NewMetricsHookForProvider(provider api.MeterProvider, opts ...MetricOptions
7676}
7777
7878func (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 ) {
8181 h .activeCounter .Add (ctx , + 1 , api .WithAttributes (semconv .FeatureFlagKey (hCtx .FlagKey ())))
8282
8383 h .requestCounter .Add (ctx , 1 ,
@@ -89,11 +89,12 @@ func (h *MetricsHook) Before(ctx context.Context, hCtx openfeature.HookContext,
8989}
9090
9191func (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 {
9494 attribs := []attribute.KeyValue {
9595 semconv .FeatureFlagKey (hCtx .FlagKey ()),
96- semconv .FeatureFlagProviderName (hCtx .ProviderMetadata ().Name )}
96+ semconv .FeatureFlagProviderName (hCtx .ProviderMetadata ().Name ),
97+ }
9798
9899 if details .Variant != "" {
99100 attribs = append (attribs , semconv .FeatureFlagVariant (details .Variant ))
@@ -122,7 +123,7 @@ func (h *MetricsHook) Error(ctx context.Context, hCtx openfeature.HookContext, e
122123 attribute .String (semconv .ExceptionEventName , err .Error ())))
123124}
124125
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 ) {
126127 h .activeCounter .Add (ctx , - 1 , api .WithAttributes (semconv .FeatureFlagKey (hCtx .FlagKey ())))
127128}
128129
@@ -167,7 +168,6 @@ func WithMetricsAttributeSetter(callback func(openfeature.FlagMetadata) []attrib
167168// descriptionsToAttributes is a helper to extract dimensions from openfeature.FlagMetadata. Missing metadata
168169// dimensions are ignore.
169170func descriptionsToAttributes (metadata openfeature.FlagMetadata , descriptions []DimensionDescription ) []attribute.KeyValue {
170-
171171 attribs := []attribute.KeyValue {}
172172 for _ , dimension := range descriptions {
173173 switch dimension .Type {
0 commit comments