Skip to content

Make the observation starter conditional on the spring actuator dpeen…#1559

Merged
Croway merged 1 commit intoapache:mainfrom
Croway:observation-conditional-autoconfiguration
Nov 4, 2025
Merged

Make the observation starter conditional on the spring actuator dpeen…#1559
Croway merged 1 commit intoapache:mainfrom
Croway:observation-conditional-autoconfiguration

Conversation

@Croway
Copy link
Contributor

@Croway Croway commented Nov 4, 2025

@Croway Croway requested review from oscerd and squakez November 4, 2025 14:04
@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter(value =
{ org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration.class, MicrometerTracingAutoConfiguration.class})
@ConditionalOnMissingClass({ "org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration",
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this would affect the fix we did for https://issues.apache.org/jira/browse/CAMEL-22612 - why is it required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is required because without spring actuator dependency (it is optional in the components starter pom.xml, which is fine), org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration class is not present in the classpath. therefore, let's disable autoconfiguration if the spring actuator is not on the class path.

{ org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration.class, MicrometerTracingAutoConfiguration.class})
@ConditionalOnMissingClass({ "org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration",
"org.springframework.boot.actuate.autoconfigure.tracing.MicrometerTracingAutoConfiguration" })
@AutoConfigureAfter(name = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Okey, I changed because I thought it was more consistent to leverage on a class instead of a string which will be converted to a class.

@Croway Croway merged commit 598b0a9 into apache:main Nov 4, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants