Add logdispatch.health.enabled property to allow opting out of the health endpoint - #46
Merged
Mahesh-Langote merged 2 commits intoAug 12, 2026
Conversation
Mahesh-Langote
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
/logdispatch/healthendpoint was always registered on any applicationusing this SDK, with no way to disable it. This meant unauthenticated
requests could always query startup time and uptime, and applications with
strict "no unauthenticated public endpoints" policies (e.g. Spring Security,
API gateways) had no way to opt out short of forking the library.
This PR adds a new
logdispatch.health.enabledproperty (defaulttrue,non-breaking) that, when set to
false, prevents theLogDispatchHealthControllerbean from being registered at all — so theendpoint doesn't exist rather than responding with a "disabled" status.
Requests to
/logdispatch/healthreturn a plain404when disabled, thesame as any other undefined route. The associated rate limiter is skipped
automatically as a result, since it only runs inside the controller.
Fixes #25
Type of change
How Has This Been Tested?
Added two new tests to
LogDispatchAutoConfigurationTest:shouldNotRegisterHealthControllerWhenHealthDisabled— confirms theLogDispatchHealthControllerbean is absent from the Spring contextwhen
logdispatch.health.enabled=false.shouldRegisterHealthControllerByDefaultWhenHealthPropertyMissing—confirms the bean is still registered by default when the property
is unset, preserving existing behavior.
Full suite run locally: 30/30 tests passing (
./mvnw clean test).Checklist: