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

Error if otelExtension is not set in dependencies #176

Open
jamesbassett opened this issue Nov 1, 2024 · 3 comments
Open

Error if otelExtension is not set in dependencies #176

jamesbassett opened this issue Nov 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jamesbassett
Copy link

I've recently tried upgrading our custom otel distribution from 0.5.2. to 0.7.0 and encountered the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':opentelemetry-java-agent:extendedAgent'.
> Expected configuration ':opentelemetry-java-agent:otelExtension' to contain exactly one file, however, it contains no files.

The stacktrace:

Caused by: java.lang.IllegalStateException: Expected configuration ':opentelemetry-java-agent:otelExtension' to contain exactly one file, however, it contains no files.
        at org.gradle.api.internal.file.AbstractFileCollection.getSingleFile(AbstractFileCollection.java:153)
        at org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration_Decorated.getSingleFile(Unknown Source)
        at com.ryandens.javaagent.otel.JavaagentOTelModificationPlugin$apply$extendedAgent$1$3.invoke(JavaagentOTelModificationPlugin.kt:57)
        at com.ryandens.javaagent.otel.JavaagentOTelModificationPlugin$apply$extendedAgent$1$3.invoke(JavaagentOTelModificationPlugin.kt:57)
        at com.ryandens.javaagent.otel.JavaagentOTelModificationPlugin$apply$extendedAgent$1.invoke$lambda$2(JavaagentOTelModificationPlugin.kt:57)

We don't use otelExtension in our dependencies but it seems like it is now required after this change

If I add it in (based on the example in that PR) it works again.

dependencies {
    otel(projectLibs.opentelemetry.javaagent)
    // TODO it seems like otelExtension is now mandatory? i.e.
    // otelExtension("io.opentelemetry.contrib:opentelemetry-samplers:1.12.0-alpha")
    otelInstrumentation(project(":otel-extensions", "shadow"))
}
@ryandens
Copy link
Owner

ryandens commented Nov 4, 2024

Thanks for the report! Definitely not intentional, i'll fix when i get the chance

@ryandens ryandens added the bug Something isn't working label Nov 4, 2024
@jamesbassett
Copy link
Author

Hi just wondering if you've had time to look at this yet?

@ryandens
Copy link
Owner

Nope!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants