-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor metrics hook class and use constants for metric names and de…
…scriptions Signed-off-by: André Silva <[email protected]>
- Loading branch information
Showing
2 changed files
with
38 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace OpenFeature.Contrib.Hooks.Otel | ||
{ | ||
internal static class MetricsConstants | ||
{ | ||
internal const string UNIT = "double"; | ||
|
||
internal const string ACTIVE_COUNT_NAME = "feature_flag.evaluation_active_count"; | ||
internal const string REQUESTS_TOTAL_NAME = "feature_flag.evaluation_requests_total"; | ||
internal const string SUCCESS_TOTAL_NAME = "feature_flag.evaluation_success_total"; | ||
internal const string ERROR_TOTAL_NAME = "feature_flag.evaluation_error_total"; | ||
|
||
internal const string ACTIVE_DESCRIPTION = "active flag evaluations counter"; | ||
internal const string REQUESTS_DESCRIPTION = "feature flag evaluation request counter"; | ||
internal const string SUCCESS_DESCRIPTION = "feature flag evaluation success counter"; | ||
internal const string ERROR_DESCRIPTION = "feature flag evaluation error counter"; | ||
|
||
internal const string KEY_ATTR = "feature_flag.key"; | ||
internal const string PROVIDER_NAME_ATTR = "feature_flag.provider_name"; | ||
internal const string VARIANT_ATTR = "feature_flag.variant"; | ||
internal const string REASON_ATTR = "feature_flag.reason"; | ||
internal const string EXCEPTION_ATTR = "exception"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters