Skip to content

Actuator Defaults and Configuration Library #32117

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

Closed
victorherraiz-santander opened this issue Aug 19, 2022 · 2 comments
Closed

Actuator Defaults and Configuration Library #32117

victorherraiz-santander opened this issue Aug 19, 2022 · 2 comments
Labels
status: duplicate A duplicate of another issue

Comments

@victorherraiz-santander
Copy link

victorherraiz-santander commented Aug 19, 2022

Spring Boot 2.7.2

I defined a library with an auto configuration that uses @PropertySource to define some defaults for the actuator endpoints

management.endpoints.web.include=health,info,metrics,prometheus

When the app that depends in that library runs expanded (Intellij play button) the actuator shows metrics and prometheus endpoints, when the app is packed or is executed using spring boot plugin the configuration does not apply and only shows info and health.

When I use an application listener in the library and set up the value using default properties it works, but I do not want to use this method, other libraries or the app could override the defaults and there is only one map for the defaults property in the application context.

It seems there is a problem setting the defaults or the order of execution is quite different when the application runs from a jar file or when the app class path is set up by Intellij.

I tried to add the @PropertySource in an @AutoConfiguration and a @ManagementContextConfiguration, I tried the change the @Order value with no luck at all.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 19, 2022
@snicoll
Copy link
Member

snicoll commented Aug 19, 2022

In general we do not recommend to use @PropertySource, especially when values have an incidence on auto-configuration. I am going to close this as a duplicate of #24688 that has more details.

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2022
@snicoll snicoll added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 19, 2022
@victorherraiz-santander
Copy link
Author

@snicoll thank you so much for the quick reply, I'll take a look at #24688

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants