-
Notifications
You must be signed in to change notification settings - Fork 47
feat: use OTel semconv constants for feature flag attributes #435
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @abisecops, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the telemetry package to align with OpenTelemetry semantic conventions for feature flag attributes. By replacing locally defined constants with Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request is a good move towards standardization by replacing local constants with OpenTelemetry semantic conventions. The core change in openfeature/telemetry/telemetry.go
is well-executed and improves maintainability by aligning with an external standard.
A key area for improvement is in the testing. The corresponding test file, openfeature/telemetry/telemetry_test.go
, has not been updated to reflect these changes. For instance, it still uses a hardcoded string "feature_flag.evaluation"
instead of the new FlagEvaluationKey
constant. While the tests may currently pass, updating them to use the exported constants is crucial for long-term robustness and maintainability. I strongly recommend including the test updates in this PR.
I've also left one minor stylistic comment regarding code formatting.
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.
Thank you
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.
Since all the attributes are already well-defined in the semantic conventions (semconv
), the telemetry
package doesn’t provide much value to go-sdk
. I believe any remaining useful parts should be moved to go-sdk-contrib/hooks/open-telemetry
, and the telemetry package should be removed from go-sdk
.
"strings" | ||
|
||
"github.com/open-feature/go-sdk/openfeature" | ||
semconv "go.opentelemetry.io/otel/semconv/v1.25.0" |
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.
this package isn't included in go.mod
go.mod
Outdated
github.com/hashicorp/go-memdb v1.3.4 // indirect | ||
github.com/hashicorp/golang-lru v1.0.2 // indirect | ||
github.com/spf13/pflag v1.0.7 // indirect | ||
github.com/stretchr/testify v1.11.1 // indirect |
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.
this is not in used, right?
Signed-off-by: Abishek Kafle <pingabisec@gmail.com>
…metry package with references to OpenTelemetry semantic conventions (semconv). Reduces maintenance and ensures alignment with OTel updates. Removes redundant constant definitions. Signed-off-by: Abishek Kafle <pingabisec@gmail.com>
Signed-off-by: Abishek Kafle <pingabisec@gmail.com>
Signed-off-by: Abishek Kafle <pingabisec@gmail.com>
I am not sure, if that should be the case, because it seems like we do this in all the SDK's for easy access to telemetric information. I think we should revisit this approach in general, because we add a dependency on the otel semconv to the base sdk, which might not be ideal anyways. - here open-feature/.github#65 - this was defined |
@abisecops Could you please double-check your work? It looks like the tests aren’t passing. |
@sahidvelji also has a draft PR open. We should align on this as soon as possible. I'd like to get the OTel support in a good place before KubeCon. |
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.
Thank you for considering contributing to the OpenFeature Go SDK!
As mentioned by @beeme1mr, there is already an existing PR (in draft). We will need to pick up the discussion again on the specifics around the future of the telemetry package and whether it should even be in this repo (or go-sdk-contrib). But until that has been finalized, I don't think we should make any changes to the telemetry package.
This PR
semconv
).Related Issues
Fixes #393
Notes
This change ensures the telemetry package uses standardized OTel feature flag attributes, making future updates easier and improving interoperability.
Follow-up Tasks
How to test