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

Exception when specifying QUARKUS_OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc #36084

Closed
cuichenli opened this issue Sep 22, 2023 · 9 comments
Closed
Assignees
Labels
area/tracing good first issue Good for newcomers kind/bug Something isn't working

Comments

@cuichenli
Copy link
Contributor

Describe the bug

When using the environment variable QUARKUS_OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc Quarkus will throw exception

Caused by: java.lang.IllegalStateException: Only the GRPC Exporter is currently supported. Please check `otel.exporter.otlp.traces.protocol` property
	at io.quarkus.opentelemetry.runtime.exporter.otlp.OtlpRecorder.createOtlpGrpcSpanExporter(OtlpRecorder.java:110)
	at io.quarkus.opentelemetry.runtime.exporter.otlp.OtlpRecorder.installBatchSpanProcessorForOtlp(OtlpRecorder.java:61)

I think this issue has been resolved in #35156 for 3.3.0, but for the older version, this is still causing issues. Can we implement a fix for the older versions?

Looks like the logic at

if (!exporterRuntimeConfig.traces().protocol().orElse("").equals(HTTP_PROTOBUF)) {
is a little bit wrong. Shouldn't the error be thrown when the protocol not equals to grpc instead?

Thanks! Please feel free to correct me if I am getting any thing wrong here.

Expected behavior

No exception should be thrown

Actual behavior

Exception thrown

How to Reproduce?

No response

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

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

No response

Additional information

No response

@cuichenli cuichenli added the kind/bug Something isn't working label Sep 22, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 22, 2023

/cc @alesj (grpc), @brunobat (opentelemetry,tracing), @cescoffier (grpc), @radcortez (opentelemetry,tracing)

@brunobat
Copy link
Contributor

cuichenli you mean: QUARKUS_OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf, right?

@cuichenli
Copy link
Contributor Author

nope, the value i set is QUARKUS_OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc

@brunobat
Copy link
Contributor

brunobat commented Sep 22, 2023

Previously to Quarkus 3.3, with the previous exporter, there was only one protocol available. Setting that property has no effect.
Due to the piping rewiring, it would be very difficult to backport.

@cuichenli
Copy link
Contributor Author

Sorry I may miss something here, but I thought to backport a fix we just need to update

 if (!exporterRuntimeConfig.traces().protocol().orElse("").equals(HTTP_PROTOBUF)) { 

to

 if (!exporterRuntimeConfig.traces().protocol().orElse("").equals(GRPC)) { 

The original code basically means if the protocol is set to grpc, then it does not equal to http/protobuf, hence one exception would be thrown.

Feel free to correct me if I am wrong.

@brunobat
Copy link
Contributor

brunobat commented Sep 22, 2023

ok, it's just about the message, got it.
In the meantime, the workaround is not to set the property a all.

@siewp
Copy link

siewp commented Sep 24, 2023

I would like to work on this simple issue :)

@brunobat
Copy link
Contributor

@siewp go for it!

@brunobat
Copy link
Contributor

fixed by #36166

@github-project-automation github-project-automation bot moved this from In Progress to Done in Quarkus Roadmap/Planning Feb 26, 2024
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

No branches or pull requests

3 participants