Skip to content

Commit 38b3b6f

Browse files
authored
feat: OTel hook changes for hook interface updates (#644)
Signed-off-by: bbland1 <[email protected]>
1 parent ce87102 commit 38b3b6f

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

hooks/open-telemetry/pkg/metrics_test.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ func TestMetricsHook_FinallyStage(t *testing.T) {
171171

172172
ctx := context.Background()
173173

174+
evalDetails := openfeature.InterfaceEvaluationDetails{
175+
Value: true,
176+
EvaluationDetails: openfeature.EvaluationDetails{
177+
FlagKey: "flagA",
178+
FlagType: openfeature.Boolean,
179+
ResolutionDetail: openfeature.ResolutionDetail{},
180+
},
181+
}
182+
174183
hookContext := hookContext()
175184
hookHints := openfeature.NewHookHints(map[string]interface{}{})
176185

@@ -181,7 +190,7 @@ func TestMetricsHook_FinallyStage(t *testing.T) {
181190
}
182191

183192
// when
184-
metricsHook.Finally(ctx, hookContext, openfeature.InterfaceEvaluationDetails{}, hookHints)
193+
metricsHook.Finally(ctx, hookContext, evalDetails, hookHints)
185194

186195
// then
187196
var data metricdata.ResourceMetrics
@@ -215,6 +224,15 @@ func TestMetricsHook_ActiveCounterShouldBeZero(t *testing.T) {
215224

216225
ctx := context.Background()
217226

227+
evalDetails := openfeature.InterfaceEvaluationDetails{
228+
Value: true,
229+
EvaluationDetails: openfeature.EvaluationDetails{
230+
FlagKey: "flagA",
231+
FlagType: openfeature.Boolean,
232+
ResolutionDetail: openfeature.ResolutionDetail{},
233+
},
234+
}
235+
218236
hookContext := hookContext()
219237
hookHints := openfeature.NewHookHints(map[string]any{})
220238

@@ -231,7 +249,7 @@ func TestMetricsHook_ActiveCounterShouldBeZero(t *testing.T) {
231249
return
232250
}
233251

234-
metricsHook.Finally(ctx, hookContext, openfeature.InterfaceEvaluationDetails{}, hookHints)
252+
metricsHook.Finally(ctx, hookContext, evalDetails, hookHints)
235253

236254
// then
237255
var data metricdata.ResourceMetrics

0 commit comments

Comments
 (0)