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

quarkus.otel.traces.sampler.arg doesn't support String value (e.g. cannot configure "jaeger_remote" sampler) #36335

Closed
calohmn opened this issue Oct 7, 2023 · 4 comments · Fixed by #36476
Assignees
Labels
area/tracing good first issue Good for newcomers kind/bug Something isn't working
Milestone

Comments

@calohmn
Copy link

calohmn commented Oct 7, 2023

Describe the bug

The Quarkus OpenTelemetry Configuration Reference mentions that the quarkus.* properties match the ones from the OpenTelemetry SDK Autoconfigure.

In the AutoConfigure SDK sampler configuration section, the otel.traces.sampler.arg property isn't explicitly restricted to having a number/double value.
In fact, in the OpenTelemetry Specification 1.25.0, section General SDK Configuration, the OTEL_TRACES_SAMPLER_ARG env var is described as possibly containing a comma separated list in case of the jaeger_remote and parentbased_jaeger_remote samplers.

But the quarkus.otel.traces.sampler.arg configuration property explicitly has a double type.

That means that a configuration of

quarkus.otel.traces.sampler: "jaeger_remote"
quarkus.otel.traces.sampler.arg: "endpoint=http://hono-jaeger:14250"

isn't supported and leads to this exception on startup:

ERROR: Failed to start application (with profile [prod])
java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
	at io.quarkus.runtime.Application.start(Application.java:101)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:61)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:32)
Caused by: io.smallrye.config.ConfigValidationException: Configuration validation failed:
	java.lang.IllegalArgumentException: SRCFG00039: The config property quarkus.otel.traces.sampler.arg with the config value "endpoint=http://hono-jaeger:14250" threw an Exception whilst being converted SRCFG00031: Expected a double value, got "endpoint=http://hono-jaeger:14250"
	at io.smallrye.config.ConfigMappingProvider.mapConfigurationInternal(ConfigMappingProvider.java:1003)
	at io.smallrye.config.ConfigMappingProvider.lambda$mapConfiguration$3(ConfigMappingProvider.java:959)
	at io.smallrye.config.SecretKeys.doUnlocked(SecretKeys.java:28)
	at io.smallrye.config.ConfigMappingProvider.mapConfiguration(ConfigMappingProvider.java:959)
	at io.smallrye.config.ConfigMappings.mapConfiguration(ConfigMappings.java:91)
	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:630)
	at io.quarkus.runtime.generated.Config.readConfig(Unknown Source)
	at io.quarkus.deployment.steps.RuntimeConfigSetup.deploy(Unknown Source)
	... 13 more

Expected behavior

quarkus.otel.traces.sampler.arg not being restricted to a double type.

Actual behavior

Setting quarkus.otel.traces.sampler.arg to a String value leads to an exception on startup.

How to Reproduce?

Use a configuration like

quarkus.otel.traces.sampler: "jaeger_remote"
quarkus.otel.traces.sampler.arg: "endpoint=http://hono-jaeger:14250"

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.2.6

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 7, 2023

/cc @brunobat (jaeger,opentelemetry,tracing), @radcortez (jaeger,opentelemetry,tracing)

@brunobat
Copy link
Contributor

brunobat commented Oct 9, 2023

@calohmn, If I understood well, you are using a custom sampler and need the arg to pass a string that can be used inside the custom sampler, right?

@hiteshkhatri97
Copy link
Contributor

@brunobat If anyone else has not yet picked up, can I work on this issue?

@brunobat
Copy link
Contributor

Hi @hiteshkhatri97, sure, you can work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tracing good first issue Good for newcomers kind/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants