feat(modules): HealthMonitor — scheduled probes with pluggable sinks (CORE-006)#2
Open
typelicious wants to merge 2 commits into
Open
feat(modules): HealthMonitor — scheduled probes with pluggable sinks (CORE-006)#2typelicious wants to merge 2 commits into
typelicious wants to merge 2 commits into
Conversation
…(CORE-006)
Replaces the anti-pattern of committing health-check log files back to the source
repo. Pure-infrastructure module, config-driven (Pydantic), no business logic.
Module: src/ops_engine/modules/health_monitor.py
• HealthMonitor.run(config) probes each endpoint and fans out to sinks.
• Sinks: stdout (default), file (ephemeral CI path, not the repo), webhook,
github_issue (creates/updates a single labeled issue on failure).
• Probe sends a sensible default User-Agent so CF/WAF-fronted endpoints don't
403 python-urllib's default.
• CLI: python -m ops_engine.modules.health_monitor --config <org-layover.yml>
• Exit code 1 on any failed check (fail_run_on_error, default true) so the
runner reflects health in its CI status.
Config: HealthCheck + HealthSink + HealthMonitorConfig in config_loader.py.
Org-only by design (not repo-level) — declare in your org-layover config.yml.
Usage example in the module docstring; see capacium-ops for a live config.
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.
Adds a generic, pure-config HealthMonitor module to the OSS template. Org layovers declare endpoints + sinks in YAML; no per-org handler code.
Why
Some layovers (e.g. capacium-ops .github/workflows/health-monitor.yml) appended health-check lines to a tracked file inside the source repo and pushed them back every 3 hours, polluting main with auto-commits. This module provides the same observability via proper sinks — stdout, file (ephemeral CI path, not the repo), webhook, or a single labeled GitHub Issue on failure — without ever writing to the source repo.
What
python -m ops_engine.modules.health_monitor --config <yml>). Default User-Agent so CF-fronted endpoints don't 403 python-urllib. Exit 1 on failure.Org-layover usage
Tested
Live smoke against docs.capacium.xyz + api.capacium.xyz/health (both CF-fronted, both 200 with the UA fix) + a synthetic 404 path (correctly flagged failed).
Follow-up
capacium-ops will switch its workflow to call this module and drop the auto-commit step.