-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Allow HealthIndicator registration in runtime #4894
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
Comments
Requested feature would be similar to |
Here's a proposal for the registry API:
Note that the API deliberately doesn't make any promises about the ordering of the health indicators returned by |
OK, I'll create a new PR to address the registry implementation. My idea in the original PR was also to leave the ordering out of the API. Regarding |
I'm still not sure about that. That's one reason why this is labelled as being for team discussion. |
I much prefer Andy's proposal regarding |
@vpavic Can you give us some concrete examples please? We're struggling to think of a real-world use case for this. |
@wilkinsona I didn't know this was such an exotic requirement :) We're having such use cases in virtually all of our projects. We develop solutions for telcos and these projects regulary include a lot of integration with proprietary external systems. Having some sort of a healt indicator to monitor the status of connection is a must, but also we often have the requirement to register, unregister and reconfigure connections to those systems during runtime. When connector to some instance of these external systems is either discarded, or a new one is created, naturally this also affects the Previously we've been using Dropwizard Metrics for our projects, and as mentioned in second post it has its registry so this is something we miss in Spring Boot and was inspiration for this issue and subsequent PR. |
You're the first person who's asked for it.
Could this also be tackled with a custom health indicator that's aware of a dynamic set of connections? |
Yes, I'm aware of that. I jokingly referred to it as "exotic requirement" because it's a pattern seen in other libraries and one that definitely has its advantages.
No, I'm afraid not. That makes it hard to obtain a reference to individual Your suggestion is part of the workaround we have in place at the moment in our project and I'm not quite happy with it. |
We're going to need to redesign a large chunk of our actuator code to support reactive programming. I think this one should go on hold until that work has been completed. |
Duplicate of #4965 |
Currently
HealthIndicator
instances are required to be registered as Spring beans in order to provide health information. This means that Boot's Health information infrastructure cannot be easily used for health information on integration points which are not known when application context is created, or are simply dynamic by nature and can be changed in runtime.IMO introduction of something like
HealthIndicator
registry would allow this use case while also retaining compatibility with current approach.If this suggestion is accepted I'd be willing to work on a PR to provide such functionality.
The text was updated successfully, but these errors were encountered: