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

Xray propagator not resolved in Spring Boot project #9917

Closed
rBrda opened this issue Nov 20, 2023 · 6 comments · Fixed by #9924
Closed

Xray propagator not resolved in Spring Boot project #9917

rBrda opened this issue Nov 20, 2023 · 6 comments · Fixed by #9924
Labels
bug Something isn't working needs triage New issue that requires triage spring boot starter

Comments

@rBrda
Copy link

rBrda commented Nov 20, 2023

Describe the bug

Propagator "xray" cannot be resolved since the classpath in the CompositeTextMapPropagatorFactory can't be resolved.

The factory imports the Xray propagator as following:

import io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator;

but then tries to check its class path like this:

isOnClasspath("io.opentelemetry.contrib.awsxray.AwsXrayPropagator")

Spring Boot version: 2.6.6
Otel version: 1.22.0

I also checked newer Otel release versions on Github, they are most probably also affected by the issue.

application.yaml

otel:
  exporter:
    otlp:
      metrics:
        enabled: false
  traces:
    exporter: otlp
  propagation:
    enabled: true
    type: xray

gradle.build

implementation("io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter:1.22.0-alpha")
implementation("io.opentelemetry.contrib:opentelemetry-aws-xray:1.22.0")
implementation("io.opentelemetry.contrib:opentelemetry-aws-xray-propagator:1.22.0-alpha")
implementation("io.micrometer:micrometer-tracing:1.1.6")
runtimeOnly("io.micrometer:micrometer-registry-otlp:1.11.5")
runtimeOnly("io.micrometer:micrometer-tracing-bridge-otel:1.1.6")

Steps to reproduce

Create a sample Spring Boot project using the configuration I provided above, and try to use "xray" as the propagator.

Expected behavior

Xray propagator is resolved.

Actual behavior

CompositeTextMapPropagatorFactory::getCompositeTextMapPropagator() is not able to resolve the configured propagator.

Javaagent or library instrumentation version

1.22.0

Environment

JDK: JDK 11.0.13
OS: MacOS 13.6

Additional context

No response

@rBrda rBrda added bug Something isn't working needs triage New issue that requires triage labels Nov 20, 2023
@rBrda
Copy link
Author

rBrda commented Nov 21, 2023

Hi @laurit and @trask !

Thank you for your PR!

I'm not sure if any of you can answer my question, but I ask anyway.

Will this fix - if approved - also be published as a patch for 1.22.0 (and other versions)?

The Spring Boot project I work can only use 1.22.0 of Opentelemetry (higher doesn't work, we get errors because of our JDK version), and I'm not allowed to upgrade either the Spring Boot version or the JDK version. We're blocked because of this bug, and it would be great if the version we use (1.22.0) would receive this change as a patch/hotfix.

@laurit
Copy link
Contributor

laurit commented Nov 21, 2023

@rBrda

Will this fix - if approved - also be published as a patch for 1.22.0 (and other versions)?

no, we don't do patch releases for old versions

The Spring Boot project I work can only use 1.22.0 of Opentelemetry (higher doesn't work, we get errors because of our JDK version), and I'm not allowed to upgrade either the Spring Boot version or the JDK version.

please elaborate, perhaps we can fix whatever it is

You can probably work around this bug by disabling

and creating these beans yourself.

@rBrda
Copy link
Author

rBrda commented Nov 21, 2023

@laurit

Ok, thank you, we'll then disable PropagationAutoConfiguration and create our custom config class with the beans.

Yes, I can elaborate. Below you can see what happens when we try to use 1.23.0 instead of 1.22.0.

We get the following error message when we try to build our project:

Execution failed for task ':bootJarMainClassName'.
> Could not resolve all files for configuration ':runtimeClasspath'.
   > Could not resolve io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0:1.23.0-alpha.
     Required by:
         project :
         project : > io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter:1.23.0-alpha > io.opentelemetry.instrumentation:opentelemetry-spring-boot:1.23.0-alpha
      > No matching variant of io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0:1.23.0-alpha was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally but:
          - Variant 'apiElements' capability io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0:1.23.0-alpha declares a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11
          - Variant 'javadocElements' capability io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0:1.23.0-alpha declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 11)
                  - Doesn't say anything about its elements (required them packaged as a jar)
          - Variant 'runtimeElements' capability io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0:1.23.0-alpha declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 11
          - Variant 'sourcesElements' capability io.opentelemetry.instrumentation:opentelemetry-spring-webmvc-6.0:1.23.0-alpha declares a runtime of a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java version (required compatibility with Java 11)
                  - Doesn't say anything about its elements (required them packaged as a jar)

@laurit
Copy link
Contributor

laurit commented Nov 22, 2023

@rBrda could you create a new issue for that so we could fix it

@rBrda
Copy link
Author

rBrda commented Nov 23, 2023

@laurit yes, sure. I'm going to create a new issue for it. Thank you!

@rBrda
Copy link
Author

rBrda commented Nov 24, 2023

@laurit I've created a new issue for the problem: #9949

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New issue that requires triage spring boot starter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants