Skip to content
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

[Enhancement] Tries to inject Vertx instance from CDI using a qualifier #381

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

gaol
Copy link
Contributor

@gaol gaol commented Sep 27, 2024

Fixes #380

This PR tries to add a new config otel.exporter.vertx.cdi.identifier to tries to inject the Vertx instance from the CDI with the qualifier, and it falls back to current way of Vertx.vertx() if there is no such configuration to keep compatible.

Copy link
Collaborator

@jasondlee jasondlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaol, This looks good. Once the formatting checks have been satisfied, I can merge this.

@gaol
Copy link
Contributor Author

gaol commented Sep 30, 2024

@jasondlee from the discussion in smallrye/smallrye-reactive-messaging#2772, do you see problem if using Identifier instead of Named qualifier in smallrye-opentelemetry ? which would mean that there will be a dependency of io.smallrye.common:smallrye-common-annotation added to the exports artifact in this project, and a dependency of io.smallrye.common.annotation to the jboss module: io.smallrye.opentelemetry in WildFly.

@gaol
Copy link
Contributor Author

gaol commented Oct 9, 2024

@jasondlee I updated the PR to use @io.smallrye.common.annotation.Identifier from smallrye-common-annotation, would you please check again ? thank you :)

@gaol
Copy link
Contributor Author

gaol commented Oct 10, 2024

Hello @jasondlee , I updated according to your feedback to log a warning message and return a new Vertx instance in case it cannot resolve from CDI. Would you please review again ? thank

@Ladicek
Copy link
Contributor

Ladicek commented Oct 10, 2024

Just interjected a few comments, feel free to ignore or do whatever you wish with them :-)

Copy link
Collaborator

@jasondlee jasondlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one last comment.

@gaol
Copy link
Contributor Author

gaol commented Oct 10, 2024

@jasondlee I think exposing one instance of a bean using a qualifier can also leave it to the lookup side to decide if it wants the bean or not. Trying to lookup the bean without qualifier will hand over the decision out :) I remembered in the zulip discussion that we want the lookup side be able to opt in, at least in the start time of integrating the vertx subsystem.

Please feel free to correct me if I am wrong. :)

@jasondlee
Copy link
Collaborator

@jasondlee I think exposing one instance of a bean using a qualifier can also leave it to the lookup side to decide if it wants the bean or not. Trying to lookup the bean without qualifier will hand over the decision out :) I remembered in the zulip discussion that we want the lookup side be able to opt in, at least in the start time of integrating the vertx subsystem.

Please feel free to correct me if I am wrong. :)

I just reread that and you're correct. Given that, I think this looks great. I'll get it merged. Thanks!

@jasondlee
Copy link
Collaborator

HI, @gaol. One more thing: commits to this repo have to be signed. Once you've signed this commit, I'll merge it.

@gaol
Copy link
Contributor Author

gaol commented Oct 11, 2024

@jasondlee Updated to signed commit :)

@jasondlee
Copy link
Collaborator

@jasondlee Updated to signed commit :)

It's still complaining that the commit isn't signed. Have you done this? https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

@gaol
Copy link
Contributor Author

gaol commented Oct 11, 2024

@jasondlee sorry, I got the wrong idea, I understood that as Signed-off-by , will update again.

…ng a qualifier

Signed-off-by: Lin Gao <aoingl@gmail.com>
@gaol
Copy link
Contributor Author

gaol commented Oct 11, 2024

@jasondlee finally, I got the the signed commit :)

@jasondlee jasondlee merged commit 6e0e060 into smallrye:main Oct 11, 2024
4 checks passed
@github-actions github-actions bot added this to the 2.8.2 milestone Oct 11, 2024
@jasondlee
Copy link
Collaborator

No worries. Got it. Thanks, @gaol , @Ladicek !

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 this pull request may close these issues.

[Enhancement] Tries to inject Vertx instance from CDI using a qualifier
4 participants