quarkiverse / quarkus-amazon-services

Quarkus Amazon Services extensions
Apache License 2.0
39 stars 48 forks source link

Open telemetry enabled requires SQS and SNS dependency for native build #1238

Closed DawidStuzynski closed 4 months ago

DawidStuzynski commented 4 months ago

Hi, I opened similar issue for this here: https://github.com/quarkusio/quarkus/issues/40220 but I thought that here might be a better place to post this issue

I am testing my SNS messages by subscribing it using SQS and reading from this SQS in tests. I have problem executing native tests, because I am getting Discovered unresolved type during parsing: software.amazon.awssdk.services.sqs.model.MessageAttributeValue. This error is reported at image build time because class io.opentelemetry.instrumentation.awssdk.v2_2.SqsParentContext$MessageAttributeValueMapGetter is registered for linking at image build time by command line and command line. If I remove quarkus.sns.telemetry.enabled=true or if I add io.quarkiverse.amazonservices:quarkus-amazon-sqs:2.13.1 like implementation and not testImplementation It also works. My question is why? I don't understand why it have to be as implementation if I only use SQS in my tests?

Here is reporoducer: https://github.com/DawidStuzynski/native-microservice-xray code is on main branch

To run integration tests I run ./gradlew clean quarkusIntTest -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.test.integration-test-profile=test

scrocquesel commented 4 months ago

@DawidStuzynski Could you test with the PR ? It should compile, but if you can check telemetry is still working.

DawidStuzynski commented 4 months ago

@scrocquesel how can I test it with PR? Is this released somewhere?

scrocquesel commented 4 months ago

@scrocquesel how can I test it with PR? Is this released somewhere?

You can checkout it (git fetch origin pull/1242/head:otel && git switch otel), run ./mvnw install -DskipTests and use 999-SNAPSHOT for the version in your project.

DawidStuzynski commented 4 months ago

Okay, thanks for answer. I will check it