Skip to content

Commit

Permalink
Add tags to evaluationActiveUpDownCounter in Finally method
Browse files Browse the repository at this point in the history
Signed-off-by: André Silva <[email protected]>
  • Loading branch information
askpt committed Dec 14, 2023
1 parent 922fcec commit 98f69eb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/OpenFeature.Contrib.Hooks.Otel/MetricsHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ public override Task Error<T>(HookContext<T> context, Exception error, IReadOnly

public override Task Finally<T>(HookContext<T> context, IReadOnlyDictionary<string, object> hints = null)
{
// evaluationActiveUpDownCounter
var tagList = new TagList
{
{ KEY_ATTR, context.FlagKey },
{ PROVIDER_NAME_ATTR, context.ProviderMetadata.Name }
};

_evaluationActiveUpDownCounter.Add(-1, tagList);

return base.Finally(context, hints);
}
}
Expand Down

0 comments on commit 98f69eb

Please sign in to comment.