feat(actuator): public install_health_indicators container scan (v26.06.98)#128
Merged
Merged
Conversation
…ase v26.06.98 The HealthIndicator container scan existed only as private closures in the FastAPI and Starlette create_app factories, each reaching into container._registrations. Promote it to a public, documented helper — pyfly.actuator.install_health_indicators — built on the container's public registered_types()/get_registration() surface, with a groups= parameter for probe-group membership, and export it together with build_actuator_routes from pyfly.actuator. All four adapter call sites (actuator + admin, both adapters) now delegate to it, so standalone processes (e.g. EDA workers serving /actuator/health/* from their own Starlette app) can wire indicators without copying framework internals. HealthAggregator gains has_indicator() and defensively copies the groups set on add_indicator().
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.
Summary
HealthIndicatorcontainer scan from private closures in the FastAPI/Starlettecreate_appfactories to a public, documented helper:pyfly.actuator.install_health_indicators(context, aggregator, *, groups=None).registered_types()/get_registration()surface — no morecontainer._registrationsaccess.HealthAggregator.has_indicator(name)added;add_indicatordefensively copies thegroupsset.install_health_indicatorsandbuild_actuator_routesfrompyfly.actuator.Out-of-web-stack processes (e.g. flydocs' EDA workers serving
/actuator/health/*for Kubernetes httpGet probes) can now wire indicators without copying framework internals.Testing
tests/actuator/test_health_indicators_wiring.py(scan, None-context no-op, bean-name precedence, idempotent rescan preserving existing registrations,groups=membership, uninstantiated-bean skip).ruff check,ruff format --check,mypy src(strict) all clean.