-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Metrics Hook #114
Conversation
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
…scriptions Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
Signed-off-by: André Silva <[email protected]>
internal const string SuccessDescription = "feature flag evaluation success counter"; | ||
internal const string ErrorDescription = "feature flag evaluation error counter"; | ||
|
||
internal const string KeyAttr = "key"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should look into why this pkg doesn't provide the attributes for FF: https://github.com/open-telemetry/opentelemetry-dotnet/tree/af83eb1043a34f82ba3bfe20c8b674ac295cfb37/src/OpenTelemetry.SemanticConventions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if they expect PRs for this or not, but we could open one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the library has not "updated" since 2022: https://www.nuget.org/packages/OpenTelemetry.SemanticConventions/1.0.0-rc9.9
Might need some help to reopen engagement there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I only left a minor suggestion :)
I don't know enough of C# to feel confident approving the PR tho, I'll delegate someone else for this :)
@beeme1mr is there a spec for these metrics somewhere? I know we have the trace semantics covered in OTel now - but I don't think there's anything specifically about metrics (correct me if I'm wrong)
Yes, thanks @thisthat . I will review from a C# perspective, just glad to have you vet the OTel-specific stuff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good work, much appreciated. I think my only concern is a lack of assertions on the attributes (if I missed that, please point me in the right direction).
@toddbaert: after inspecting the Java library I noticed a few differences that I want to correct:
|
Signed-off-by: André Silva <[email protected]>
I noticed this, and it didn't immediately concern me because it's something that can be added later without breakage. If you want, you can add it in this PR though. Otherwise I'll simply create a new issue.
Here's how it was implemented in JS: https://github.com/open-feature/js-sdk-contrib/blob/1db63dca9a392c14f1574ec5ea8bda53f44123cd/libs/hooks/open-telemetry/src/lib/metrics/metrics-hook.spec.ts#L103-L112, if that's at all helpful! |
Signed-off-by: André Silva <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
@@ -4,6 +4,7 @@ components: | |||
src/OpenFeature.Contrib.Hooks.Otel: | |||
- bacherfl | |||
- toddbaert | |||
- askpt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@askpt I hope you don't mind I've added you here. This will add you to PRs for this component automatically, once you're an org member.
Please create a new issue. This PR is already big enough and it's not a breaking change as you mentioned.
I am trying to find a way to do it but it doesn't seem possible. The counter tags are private in the meter class |
Done.
OK in that case I'm tempted to call the testing good enough, given the limitations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved in light of this comment.
I'll merge this EOD unless I hear objections. |
This PR
Related Issues
Fixes #113