diff --git a/src/OpenFeature/Hooks/MetricsHook.cs b/src/OpenFeature/Hooks/MetricsHook.cs index 99fe4c9b..b6d088a5 100644 --- a/src/OpenFeature/Hooks/MetricsHook.cs +++ b/src/OpenFeature/Hooks/MetricsHook.cs @@ -85,7 +85,10 @@ public override ValueTask ErrorAsync(HookContext context, Exception error, } /// - public override ValueTask FinallyAsync(HookContext context, IReadOnlyDictionary? hints = null, CancellationToken cancellationToken = default) + public override ValueTask FinallyAsync(HookContext context, + FlagEvaluationDetails evaluationDetails, + IReadOnlyDictionary? hints = null, + CancellationToken cancellationToken = default) { var tagList = new TagList { @@ -95,6 +98,6 @@ public override ValueTask FinallyAsync(HookContext context, IReadOnlyDicti this._evaluationActiveUpDownCounter.Add(-1, tagList); - return base.FinallyAsync(context, hints, cancellationToken); + return base.FinallyAsync(context, evaluationDetails, hints, cancellationToken); } } diff --git a/test/OpenFeature.Tests/Hooks/MetricsHookTests.cs b/test/OpenFeature.Tests/Hooks/MetricsHookTests.cs index 69b935d6..5192df37 100644 --- a/test/OpenFeature.Tests/Hooks/MetricsHookTests.cs +++ b/test/OpenFeature.Tests/Hooks/MetricsHookTests.cs @@ -98,9 +98,10 @@ public async Task Finally_Test() var evaluationContext = EvaluationContext.Empty; var ctx = new HookContext("my-flag", "foo", Constant.FlagValueType.String, new ClientMetadata("my-client", "1.0"), new Metadata("my-provider"), evaluationContext); + var evaluationDetails = new FlagEvaluationDetails("my-flag", "foo", Constant.ErrorType.None, "STATIC", "default"); // Act - await metricsHook.FinallyAsync(ctx, new Dictionary()).ConfigureAwait(true); + await metricsHook.FinallyAsync(ctx, evaluationDetails, new Dictionary()).ConfigureAwait(true); this._meterProvider.ForceFlush(); // Assert metrics