Skip to content

[flagd] follow-up refactoring #390

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

Closed
4 of 5 tasks
thisthat opened this issue Aug 3, 2023 · 11 comments · Fixed by #505
Closed
4 of 5 tasks

[flagd] follow-up refactoring #390

thisthat opened this issue Aug 3, 2023 · 11 comments · Fixed by #505
Assignees

Comments

@thisthat
Copy link
Member

thisthat commented Aug 3, 2023

Tasks

Preview Give feedback
@toddbaert
Copy link
Member

See my comment here, I'm not sure we can really do much about the 4th point.

The rest looks good.

@Kavindu-Dodan
Copy link
Collaborator

I will work on this :)

@Kavindu-Dodan
Copy link
Collaborator

@thisthat except for this, we have completed all other tasks. And this last one is not necessary for the current operation of flagd. Further, in-process provider proposed through #411 will provider more options to use flagd.

I am voting to close this as complete

@thisthat
Copy link
Member Author

I think also the last point (always use OTel) is not yet done.
In the code (link), we instrument the gRPC streams only if we pass an SDK instance instead of acting as a library and get the default tracer all the time. OTel docs: https://opentelemetry.io/docs/concepts/instrumentation/libraries/

@thiyagu06
Copy link
Member

I think also the last point (always use OTel) is not yet done. In the code (link), we instrument the gRPC streams only if we pass an SDK instance instead of acting as a library and get the default tracer all the time. OTel docs: https://opentelemetry.io/docs/concepts/instrumentation/libraries/

We already discussed about this in #286 (comment). are we changing from this stance and planning to use GlobalOpenTelemetry ?

@Kavindu-Dodan
Copy link
Collaborator

@thisthat could you please explain your suggestion in detail? I cannot fully understand the requirements you are proposing.

Besides @thiyagu06 has a good point about using global telemetry.

@thisthat
Copy link
Member Author

Sorry to overlook this ticket for so long @thiyagu06 and @Kavindu-Dodan 🤦
The problem is with the following lines:

if (options.getOpenTelemetry() != null) {
return new TracedResolving(options.getOpenTelemetry());
}
return new SimpleResolving();

If we don't pass an OTel instance, gRPC will never be instrumented. This is a problem when you work with Agent auto-instrumentation that provides an SDK implementation at runtime.

Since auto-instrumentation for Java is quite powerful (see OTel java-instrumentation or other Observability vendors), I would suggest changing the lines before. If the App developer didn't provide an OpenTelemetry instance, we default to using theGlobalOpenTelemetry one. This way, also with auto-instrumentation we can attach to the gRPC spans the FF evaluation details.

@Kavindu-Dodan
Copy link
Collaborator

I checked the concerned usage and I have the following suggestion,

  • We should still allow traces-free simple resolving
  • Give an option to use global OTel
  • Continue to support OTel SDK injection through builder

This fulfils all the requirements.

@Kavindu-Dodan
Copy link
Collaborator

@thisthat please check this PR with the fix - #505

This is the best approach I could think of

@thisthat
Copy link
Member Author

We should still allow traces-free simple resolving

Wouldn't this be achieved through the no-op implementation of the Otel API? 🤔

@Kavindu-Dodan
Copy link
Collaborator

We should still allow traces-free simple resolving

Wouldn't this be achieved through the no-op implementation of the Otel API? 🤔

We could, but that means we have a few extra calls backed by no-op implementation. And if someone wants to avoid those calls, traces-free resolving helps.

DBlanchard88 pushed a commit to DBlanchard88/java-sdk-contrib that referenced this issue Apr 29, 2024
…ure#390)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants