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

Support exclusion of non-application URIs if custom Sampler is used #26367

Conversation

mun711
Copy link
Contributor

@mun711 mun711 commented Jun 25, 2022

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 25, 2022

/cc @radcortez

@mun711 mun711 force-pushed the feature/support-exclusion-non-app-uri-custom-sampler branch from b398043 to 7f5fa03 Compare June 25, 2022 21:41
@mun711 mun711 force-pushed the feature/support-exclusion-non-app-uri-custom-sampler branch from 7f5fa03 to dfcc22c Compare June 26, 2022 14:00
@radcortez
Copy link
Member

Thank you for the PR!

I'm not totally sure if we want to support adding samplers as CDI Beans. I know that we already have a few other things that we configure with CDI Beans, but I believe that was a mistake.

OTel now provides a well-defined configuration to set a lot of stuff, we just need to support it first. I think our goal should be to move to https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md and use otel.traces.sampler to set up the Sampler.

@radcortez radcortez mentioned this pull request Jun 29, 2022
5 tasks
@mun711
Copy link
Contributor Author

mun711 commented Jul 3, 2022

Thank you for the PR!

I'm not totally sure if we want to support adding samplers as CDI Beans. I know that we already have a few other things that we configure with CDI Beans, but I believe that was a mistake.

OTel now provides a well-defined configuration to set a lot of stuff, we just need to support it first. I think our goal should be to move to https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md and use otel.traces.sampler to set up the Sampler.

@radcortez - Thanks for the reply
I checked out the link for opentelemetry autoconfiguration. It seems that such a migration will require quite a few changes. I don't have a full understanding of the quarkus recorder pattern, but I could see that the current opentelemetrysdk is created at that point, and my guess is that we want to somehow replace with AutoConfiguredOpenTelemetrySdk, as well as add some customizations to support custom sampler enhancements and possibly url dropping as a configuration property both for custom and existing samplers.

If we go ahead with the autoconfigure ticket I guess this PR and the relevant issue may be closed as no longer wanted ?

@radcortez
Copy link
Member

If we go ahead with the autoconfigure ticket I guess this PR and the relevant issue may be closed as no longer wanted ?

Not sure yet.

I do know that we want to go with the OTel way to configure things. Since they already have a way to configure all of their APIs we should go with that instead of providing specific ways to configure stuff (CDI Beans).

We don't even have support configuration as CDI Beans for everything, so we would either need to add it to make it consistent or drop it altogether. This means that we need to somehow migrate / deprecate the current CDI support.

Maybe we just need to offer our custom Sampler that users can extend that excludes the non-application uris out of the box.

@luneo7
Copy link
Contributor

luneo7 commented Jul 6, 2022

The way that Quarkus configures samplers today gives the possibility of using CDI beans already, so the PR is not adding this functionality, it is just extending the exclusion of non-application URIs also if the CDI bean is used. I know that when that sampler as a bean was added, was because AWS X-Rray Sampler needed custom configuration and needed to use a custom bean as the OTEL auto configuration thing wouldn't configure it, and the auto configuration stuff was in alpha.
I think that maybe we can add support as this PR proposes, and when we migrate to use OTEL auto configuration stuff, we should make it support everything that we already do with Quarkus current approach.

The thing about exposing a custom Sampler, is that people will need to extend that, and also extend another Sampler or create a custom delegate on top of Quarkus custom sampler to use the desired sampler (AWS X-Ray for instance), I think that is it adds more complexity.

@mun711 mun711 force-pushed the feature/support-exclusion-non-app-uri-custom-sampler branch from dfcc22c to 8091037 Compare July 8, 2022 17:43
@radcortez
Copy link
Member

I know, but I want to avoid additional behavior relying on CDI. Ideally, we should replace the CDI Sampler with the OTel config, but I agree that it may take a while.

@mun711 mun711 force-pushed the feature/support-exclusion-non-app-uri-custom-sampler branch 2 times, most recently from 7996a55 to f53762e Compare July 15, 2022 17:05
@mun711 mun711 force-pushed the feature/support-exclusion-non-app-uri-custom-sampler branch from f53762e to 78d3067 Compare July 19, 2022 18:05
@gsmet gsmet merged commit a7cb164 into quarkusio:main Aug 9, 2022
@quarkus-bot quarkus-bot bot added this to the 2.12 - main milestone Aug 9, 2022
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Aug 9, 2022
@gsmet
Copy link
Member

gsmet commented Aug 9, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tracing kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenTelemetry: Support exclusion of non-application URIs if custom Sampler is used
4 participants