Fix ElasticsearchHealthCheck event-driven integration and rename to SearchHealthCheck
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
The ElasticsearchHealthCheck is not properly integrated with the ElasticsearchHealthEventManager, causing both traditional and event-driven health checks to run simultaneously and call the expensive /_nodes/stats endpoint. This results in performance issues and frequent timeouts. Additionally, the component should be renamed to SearchHealthCheck to reflect the move to OpenSearch.
Problem
- ElasticsearchHealthCheck extends HealthCheckBase but does not override getEventManager() or supportsEventDriven()
- Both ElasticsearchHealthCheck and ElasticsearchHealthEventManager call getClusterStats() which hits /_nodes/stats
- Results in expensive endpoint being called every 30 seconds from traditional polling AND every 30 seconds from event-driven pings
- Component name should reflect OpenSearch transition
Root Cause
ElasticsearchHealthCheck is missing the required integration with ElasticsearchHealthEventManager:
- Missing @Inject ElasticsearchHealthEventManager
- Missing getEventManager() override
- Missing supportsEventDriven() override
Solution
- Add proper event-driven integration to ElasticsearchHealthCheck
- Rename to SearchHealthCheck for OpenSearch compatibility
- Update related class names and references
- Consider using lightweight /_cluster/health endpoint instead of /_nodes/stats
Impact
- Reduces expensive Elasticsearch calls from every 15s effectively to every 90s
- Improves system performance under load
- Aligns naming with OpenSearch transition
Acceptance Criteria
- [Define what needs to be accomplished]
Additional Notes
[Any additional context or notes]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating ElasticsearchHealthCheck, ElasticsearchHealthEventManager, and HealthCheckBase, then trace how getClusterStats() is invoked by polling and event-driven checks. Done means the health check is integrated with the event manager, duplicate expensive calls are avoided, related references use SearchHealthCheck, and the endpoint choice is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100