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

add resource detectors to spring starter #10277

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {
api("org.springframework.boot:spring-boot-starter:$springBootVersion")
api("org.springframework.boot:spring-boot-starter-aop:$springBootVersion")
api(project(":instrumentation:spring:spring-boot-autoconfigure"))
implementation(project(":instrumentation:resources:library"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you choose to add this as implementation when all the other dependencies are api?
secondly these resource providers use the SPI that the sdk autoconfigure module uses, but spring boot starter does not uses the sdk autoconfigure. Even if you add them do they actually do anything?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would see more the new dependency included in spring:spring-boot-autoconfigure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. implementation is more conservative (doesn't allow access to transitive dependencies), so I use that by default
  2. .. does not use autoconfigure ... -> I've been wondering the same - is there there a good reason for that?
  3. will it work? Yes, there's a guard that checks if the class exists

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zeitlinger Could you develop one feature for OTel Spring autoconfiguration with this dependency and with one test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would see more the new dependency included in spring:spring-boot-autoconfigure.

autoconfigure modules should be as thin as possible, and starters add what's usually needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autoconfigure modules should be as thin as possible, and starters add what's usually needed.

It's not the case. The Spring autoconfigure module contains all the Java code used by the OpenTelemetry starter and the Zipkin starter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resource library is compileOnly in Spring autoconfiguration. Do we want to include it by default?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will it work? Yes, there's a guard that checks if the class exists

Thanks.

autoconfigure modules should be as thin as possible, and starters add what's usually needed.

I don't have a strong opinion for that. Might as well solve it by documenting that adding the resources library dependency can be useful. Perhaps this should be discussed at the SIG meeting.

api("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi")
api("io.opentelemetry:opentelemetry-api")
api("io.opentelemetry:opentelemetry-exporter-logging")
Expand Down
Loading