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

The ConfigValue instance for quarkus.otel.sdk.disabled is null during relocation #33493

Closed
ppatierno opened this issue May 19, 2023 · 5 comments · Fixed by #33565
Closed

The ConfigValue instance for quarkus.otel.sdk.disabled is null during relocation #33493

ppatierno opened this issue May 19, 2023 · 5 comments · Fixed by #33565

Comments

@ppatierno
Copy link
Contributor

While porting our Strimzi HTTP bridge from Quarkus 2.x to 3.x, I found a potential issue around the quarkus.otel.sdk.disabled property.

Let me set the use case first ... with Quarkus 2.x.
In our bridge we are currently using a bridge.tracing=opentelemetry property to enable/disable OpenTelemetry. We know that it's not possible enable/disable tracing at runtime with Quarkus 2.x and together with @brunobat we came with a workaround about just disabling the sampler to avoid sending traces. It was done by using a configuration relocator interceptor like this one here. The relocator purpose is to take backward compatibility (user still needs to set or not bridge.tracing property).

When moving to Quarkus 3.x we have the quarkus.otel.sdk.disabled property which allows to enable/disable tracing at runtime so the "sampler" workaround is not needed anymore.
Following the same logic I was going to relocate that property via our own bridge.tracing but when the following snippet of code runs, the quarkus.otel.sdk.disabled result to be null.

ConfigValue original = context.proceed("quarkus.otel.sdk.disabled");

I am just following the same logic as before but using the quarkus.otel.sdk.disabled instead of the quarkus.opentelemetry.tracer.sampler which is not null and works fine.

@quarkus-bot
Copy link

quarkus-bot bot commented May 19, 2023

/cc @brunobat (micrometer), @ebullient (metrics,micrometer), @jmartisk (metrics)

@ppatierno
Copy link
Contributor Author

/cc @radcortez

@brunobat
Copy link
Contributor

I'm not sure I follow.
Will quarkus.otel.sdk.disabled not disable the OTel SDK?
Where is this snippet? ConfigValue original = context.proceed("quarkus.otel.sdk.disabled");
In the service code? At which point? Do you have a reproducer?

@ppatierno
Copy link
Contributor Author

I haven't pushed the code yet, I will do soon but if you follow the link I pasted before, so this one https://github.com/ppatierno/strimzi-kafka-bridge/blob/road-to-quarkus/src/main/java/io/strimzi/kafka/bridge/config/BridgeRelocateConfigInterceptor.java#L79 and replace quarkus.opentelemetry.tracer.sampler with quarkus.otel.sdk.disabled, the line with ConfigValue original = context.proceed("quarkus.otel.sdk.disabled"); return null.

@ppatierno
Copy link
Contributor Author

FYI I pushed the code.
The code where this is happening is here https://github.com/ppatierno/strimzi-kafka-bridge/blob/road-to-quarkus/src/main/java/io/strimzi/kafka/bridge/config/BridgeRelocateConfigInterceptor.java#L73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants