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

MN OTel HTTP add API dependencies on the annotation processor libraries #553

Closed
musketyr opened this issue Apr 29, 2024 · 2 comments · Fixed by #559
Closed

MN OTel HTTP add API dependencies on the annotation processor libraries #553

musketyr opened this issue Apr 29, 2024 · 2 comments · Fixed by #559
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@musketyr
Copy link

Expected Behavior

Annotation processor libraries such as Micronaut Core Processor should not be added to the runtime classpath.

Actual Behaviour

Micronaut OpenTelemetry HTTP depends on Micronaut OpenTelemetry Annotations that depends on Micronaut Core Processor that for example pulls unnecessary 7.1 MB JAR of Java Parser.

Steps To Reproduce

You can follow the OpenTelementry guide. Once the following dependency is added you can see that there are also Micronaut Core Processor and Java Parser on the classpath.

implementation("io.micronaut.tracing:micronaut-tracing-opentelemetry-http")

Snímek obrazovky 2024-04-29 v 13 11 03

Environment Information

No response

Example Application

https://guides.micronaut.io/latest/micronaut-microservices-distributed-tracing-jaeger-opentelemetry-maven-java.html#micronaut-opentelemetry-http

Version

4.3.8

@graemerocher graemerocher added the type: bug Something isn't working label Apr 29, 2024
@timyates
Copy link
Contributor

timyates commented May 2, 2024

I will work on splitting the annotation classes away from the processors (as we did for EclipseStore).

This will be a major change, so will need to be in Micronaut 5

@timyates timyates removed this from 4.4.2 Release May 2, 2024
@timyates timyates moved this to In Progress in 5.0.0 Release May 2, 2024
@timyates
Copy link
Contributor

timyates commented May 2, 2024

Actually, I may have spoken too soon... Investigating...

timyates added a commit that referenced this issue May 2, 2024
Closes #553

The Micronaut OpenTelemetry Http plugin was exposing an API dependency on the processor classes.
This in turn pulled in 7Mb of unrequired dependencies.

This PR fixes this issue, and does a tiny bit of cleanup.

In general, this module seems to have an excessive use of `api` for dependencies.
But I don't think we can do much more without causing downstream breakages.

I ran the guide mentioned in the issue, and then re-ran it with a snapshot version of this PR, the following Build Scans were the result:

`bookcatalog`
- before https://ge.micronaut.io/s/ofkuix744eine
- after https://ge.micronaut.io/s/s6wap7cgohfzs

`bookinventory`
- before https://ge.micronaut.io/s/vokg7vtiyhztg
- after https://ge.micronaut.io/s/67p35n6pkovce

`bookrecommendation`
- before https://ge.micronaut.io/s/6ozkmgcfwtgb4
- after https://ge.micronaut.io/s/i3hi5u2iwgjzs
@timyates timyates removed this from 5.0.0 Release May 2, 2024
@timyates timyates moved this to Ready for Review in 4.4.2 Release May 2, 2024
@timyates timyates added this to the 6.5.2 milestone May 2, 2024
sdelamo pushed a commit that referenced this issue May 3, 2024
Closes #553

The Micronaut OpenTelemetry Http plugin was exposing an API dependency on the processor classes.
This in turn pulled in 7Mb of unrequired dependencies.

This PR fixes this issue, and does a tiny bit of cleanup.

In general, this module seems to have an excessive use of `api` for dependencies.
But I don't think we can do much more without causing downstream breakages.

I ran the guide mentioned in the issue, and then re-ran it with a snapshot version of this PR, the following Build Scans were the result:

`bookcatalog`
- before https://ge.micronaut.io/s/ofkuix744eine
- after https://ge.micronaut.io/s/s6wap7cgohfzs

`bookinventory`
- before https://ge.micronaut.io/s/vokg7vtiyhztg
- after https://ge.micronaut.io/s/67p35n6pkovce

`bookrecommendation`
- before https://ge.micronaut.io/s/6ozkmgcfwtgb4
- after https://ge.micronaut.io/s/i3hi5u2iwgjzs
@sdelamo sdelamo closed this as completed May 3, 2024
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in 4.4.2 Release May 3, 2024
timyates added a commit to micronaut-projects/micronaut-starter that referenced this issue May 8, 2024
We had an api dependency on micronaut-core-processor which meant it was ending up on the runtime classpath.

This was fixed here

micronaut-projects/micronaut-tracing#553 (comment)

However for Maven and Groovy this causes a failure as it no longer ends up getting pulled onto the provided configuration.

Once this fix is released, we can remove the skips from the jaeger and zipkin guides here:

micronaut-projects/micronaut-guides@798040a#diff-429b78dd62241a22ac3b663ca2d045441a9326121c3b6bbf19f5859d94c2e3d8
sdelamo pushed a commit to micronaut-projects/micronaut-starter that referenced this issue May 8, 2024
We had an api dependency on micronaut-core-processor which meant it was ending up on the runtime classpath.

This was fixed here

micronaut-projects/micronaut-tracing#553 (comment)

However for Maven and Groovy this causes a failure as it no longer ends up getting pulled onto the provided configuration.

Once this fix is released, we can remove the skips from the jaeger and zipkin guides here:

micronaut-projects/micronaut-guides@798040a#diff-429b78dd62241a22ac3b663ca2d045441a9326121c3b6bbf19f5859d94c2e3d8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
No open projects
Status: Done
4 participants