-
Notifications
You must be signed in to change notification settings - Fork 51
feat: flagd manual otel interceptor for grpc #286
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: flagd manual otel interceptor for grpc #286
Conversation
providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/FlagdProvider.java
Outdated
Show resolved
Hide resolved
providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/FlagdProvider.java
Show resolved
Hide resolved
b9c4647
to
e21ded7
Compare
a5dcbb2
to
4c71dff
Compare
Just out of curiosity, can't this instrumentation be implemented using hooks? |
providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/FlagdProvider.java
Show resolved
Hide resolved
providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/FlagdProvider.java
Show resolved
Hide resolved
Hey @thiyagu06, not really. With the hooks, you cannot instrument the provider to propagate the W3C context. |
fa99f5c
to
dea3bd0
Compare
Yes. got it. My concern here is, for an application authors who uses an auto instrumentation of open telemetry, creating an instance of OpenTelemetrySdk and passing it as an constructor argument Instead, I would prefer to obtain the opentelemetry instance by calling |
Gotcha! Thanks for noticing it. I agree with you. We should not use the SDK part of OTel here and instead only rely on the API since we are a third party library 👍 |
I re-checked the documentation and the recommended way it to pass down an instance of
I will update this and this will allow us to get rid of sdk dependency. [1] - https://opentelemetry.io/docs/instrumentation/java/manual/#example |
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.
After reading your docs I think I agree with this solution. Thanks for taking the time.
I think you may want to add some documentation about this to the README, and maybe even some of the links from this comment.
Approving but I'd like to hear once again from @thiyagu06 or @thisthat .
Thank you 🙌 Regarding the documentation, yes agree with the input. I will include an explanation with the next PR #294 where I try to improve the overall usage of constructors :) |
Works for me! |
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
a8fd661
to
0faf1b8
Compare
Signed-off-by: Kavindu Dodanduwa <[email protected]> Signed-off-by: Lars Opitz <[email protected]>
This PR
Fixes #283 by introducing manual tracing [1] for flagd Java sdk
This PR introduce a new constructor to provide an OpenTelemetry SDK. Internally, this is used to intercept grpc communication and add simple span for evaluation.
With a proper setup, we get distributed telemetry for flagd ecosystem
Note - a follow-up refactoring is ready to improve constructor behavior #294
[1] - https://opentelemetry.io/docs/instrumentation/java/manual/