mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-30 09:32:45 +01:00
Align Patrol modes and Adaptive Polling docs with runtime (#5257)
Remove nonexistent pulse_patrol_* Prometheus claims from docs/AI_AUTONOMY.md and its shipped Help mirror, document the actual pulse_ai_* and pulse_operational_trust_* counters plus Patrol status/run API endpoints, align continuing Relay Pro entitlements and the 31 March 2027 retirement date, and document stored vs API investigation fields, the 20-minute failed-fix retry cooldown and the 64-entry deferred investigation queue. Update docs/monitoring/ADAPTIVE_POLLING.md to document PULSE_METRICS_PORT precedence over legacy METRICS_PORT, local per-monitor staleness scoring, stopped-scheduler queue and dead-letter exclusion, 5-minute dead-letter series expiry, and latest-completion freshness snapshots. Add regression checks in test_public_docs_claims.py and test_scheduler_polling_docs.py. Contract-Neutral: Documentation and documentation regression tests only; no runtime, API, or subsystem contract changes. --- Fleet candidate `20261127T075643Z-product-intelligence` from the `product-intelligence` lane. Reviewed tip `1814ede998541b6ab41badb8af42523ca4d0137e` on `main`. [How Pulse handles triage](https://github.com/rcourtman/Pulse/blob/main/docs/AI_TRANSPARENCY.md)
This commit is contained in:
@@ -29,11 +29,13 @@ Patrol mode sets how far Pulse can go when Patrol finds something that needs att
|
||||
| **Safe auto-fix** | `assisted` | Yes | Yes | Execute automatically | Approval required | Pro / legacy Pro+ / Cloud |
|
||||
| **Autopilot** | `full` | Yes | Yes | Execute automatically | Execute automatically | Pro / legacy Pro+ / Cloud |
|
||||
|
||||
- **Watch only**: Patrol creates findings but takes no action. This is the Community and Relay baseline and the default without Pro. Suitable for learning what Patrol detects before enabling investigation or fix execution.
|
||||
- **Watch only**: Patrol creates findings but takes no action. This is the Community baseline and the default without Pro. Suitable for learning what Patrol detects before enabling investigation or fix execution.
|
||||
- **Ask first** (Pro and above): Patrol investigates findings and proposes fixes. All fixes queue for manual approval before execution.
|
||||
- **Safe auto-fix** (Pro and above): Warning-level safe fix plans can execute automatically. Critical findings still require approval. This is the recommended starting point for most Pro and legacy Pro+ users who enable fix execution.
|
||||
- **Autopilot** (Pro and above): Safe fix plans can execute without approval. Activation requires an explicit human-session acknowledgement and a Pro, legacy Pro+, or Cloud license. Recommended only for environments with thorough alert coverage.
|
||||
|
||||
Relay is no longer sold, and Pulse Mobile and Relay retire on 31 March 2027. Continuing Relay subscribers receive Pro entitlements, including Pro Patrol modes, at their current price while their subscription continues.
|
||||
|
||||
On Pro, an install that has never chosen a mode runs **Ask first**, so new warning and critical findings are investigated without an extra step. Until you choose, the Patrol page explains this and offers to keep Ask first or switch to Watch only; either choice is saved and the notice goes away. Investigations use your AI provider and count toward the 30-day budget. A mode you have saved, including Watch only, is never changed.
|
||||
|
||||
### Configuration
|
||||
@@ -89,8 +91,8 @@ licence and policy enforcement still apply.
|
||||
|
||||
### License Requirements
|
||||
|
||||
- `monitor`: Available on all plans. Community and Relay can run Patrol with BYOK.
|
||||
- `approval`, `assisted`, and `full`: Require the `ai_autofix` capability (Pro, legacy Pro+, or Cloud license).
|
||||
- `monitor`: Available on all plans. Community installs can run Patrol in Watch only mode with BYOK.
|
||||
- `approval`, `assisted`, and `full`: Require the `ai_autofix` capability (Pro, continuing Relay, legacy Pro+, or Cloud license).
|
||||
|
||||
Without the `ai_autofix` capability, the effective Patrol mode is clamped to `monitor` at runtime, regardless of the saved configuration. If you previously had a Pro license and downgraded, your saved setting is preserved but enforcement reverts to `monitor`.
|
||||
|
||||
@@ -155,12 +157,12 @@ JSON
|
||||
|
||||
When Patrol mode is `approval`, `assisted`, or `full`, Patrol investigates findings. These parameters tune investigation behavior:
|
||||
|
||||
| Setting | Default | Range | Description |
|
||||
|---------|---------|-------|-------------|
|
||||
| `patrol_investigation_budget` | 10 | 5–30 | Maximum evidence-tool calls per investigation; Patrol derives a separate model-response safety ceiling |
|
||||
| `patrol_investigation_timeout_sec` | 600 (1500 for subscription CLIs) | 60–1800 | Maximum seconds per investigation. Subscription agent CLIs (`codex-subscription`, `claude-subscription`) default to 1500 seconds (25 minutes) when unset. |
|
||||
| Stored config key | API field (`/api/ai/patrol/autonomy`) | Default | Range | Description |
|
||||
|---------|---------|---------|-------|-------------|
|
||||
| `patrol_investigation_budget` | `investigation_budget` | 10 | 5-30 | Maximum evidence-tool calls per investigation. Patrol derives a separate model-response safety ceiling. |
|
||||
| `patrol_investigation_timeout_sec` | `investigation_timeout_sec` | 600 (1500 for subscription CLIs) | 60-1800 | Maximum seconds per investigation. Subscription agent CLIs (`codex-subscription`, `claude-subscription`) default to 1500 seconds (25 minutes) when unset. |
|
||||
|
||||
The following limits are fixed and cannot be changed: up to 3 investigations run in parallel, up to 3 attempts per finding, a 1 hour cooldown before re-investigating a finding, and a shorter 10 minute cooldown after a timeout failure.
|
||||
The following limits are fixed in the runtime and cannot be changed: up to 3 investigations run in parallel (up to 64 additional findings can wait in memory for a free slot, prioritised critical-first), up to 3 attempts per finding, a 1 hour default cooldown between investigation attempts, a 20 minute cooldown after a failed fix or failed fix verification, and a 10 minute cooldown after a timed-out outcome. Runs that fail before producing a conclusion, are interrupted by a restart, or end with unknown fix verification carry no extra cooldown and wait for the next scheduled Patrol cycle.
|
||||
|
||||
---
|
||||
|
||||
@@ -210,24 +212,28 @@ For new deployments, gradually increase Patrol mode:
|
||||
|
||||
## Monitoring AI Activity
|
||||
|
||||
### Patrol Metrics
|
||||
### Prometheus Metrics
|
||||
|
||||
Prometheus counters (prefix `pulse_patrol_*`) track:
|
||||
- Patrol runs, findings, investigations, fixes
|
||||
- Fix outcomes (success, failure, verification status)
|
||||
- Circuit breaker trips
|
||||
Pulse does not export a `pulse_patrol_*` Prometheus metric family. On the separate Prometheus metrics listener (`docs/monitoring/PROMETHEUS_METRICS.md`), two metric families cover AI runtime guardrails and governed action outcomes:
|
||||
|
||||
- **AI loop and safety counters (`pulse_ai_*`):** `pulse_ai_agentic_iterations_total`, `pulse_ai_strict_resolution_block_total`, `pulse_ai_routing_mismatch_block_total`, and `pulse_ai_phantom_detected_total`
|
||||
- **Operational Trust action counters (`pulse_operational_trust_*`):** `pulse_operational_trust_action_offers_total` and `pulse_operational_trust_action_verification_total`
|
||||
|
||||
For Patrol run counts, finding investigation status, and provider circuit-breaker state, use the Patrol UI or the API endpoints below.
|
||||
|
||||
### Cost Tracking
|
||||
|
||||
Token usage and estimated costs are tracked per provider:
|
||||
- **UI:** Settings → Pulse Intelligence → Provider & Models → Provider Usage & Spend
|
||||
- **API:** `GET /api/ai/cost/summary`
|
||||
- Set monthly budget limits to cap spending
|
||||
- Set a 30-day budget limit (`30-day budget (USD)`) to flag spend over budget
|
||||
|
||||
### Investigation Status
|
||||
### Patrol and Circuit Status
|
||||
|
||||
- **API:** `GET /api/ai/patrol/findings` — List all findings with investigation status
|
||||
- **API:** `GET /api/ai/circuit/status` — Check circuit breaker state
|
||||
- **API:** `GET /api/ai/patrol/status` for current Patrol runtime status
|
||||
- **API:** `GET /api/ai/patrol/runs` for recent Patrol run history
|
||||
- **API:** `GET /api/ai/patrol/findings` for active findings and investigation status
|
||||
- **API:** `GET /api/ai/circuit/status` for AI provider circuit breaker state
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ intervals just to identify the held stage.
|
||||
## 🔬 Implementation Details (Developer Info)
|
||||
|
||||
### Staleness Scoring
|
||||
The `AdaptiveScheduler` (`internal/monitoring/scheduler.go`) relies on the `StalenessTracker` to compute a `StalenessScore` (0.0 to 1.0) based on **how long it has been since the last successful poll**.
|
||||
The `AdaptiveScheduler` (`internal/monitoring/scheduler.go`) relies on the `StalenessTracker` to compute a `StalenessScore` (0.0 to 1.0) from **how long it has been since the last successful poll recorded by that monitor**.
|
||||
|
||||
- `0.0` = fresh (recent success)
|
||||
- `1.0` = very stale or never succeeded
|
||||
- `1.0` = very stale or never succeeded (including a recorded error before any success)
|
||||
|
||||
The staleness score is normalized against `AdaptivePollingMaxInterval` (default 5 minutes).
|
||||
The staleness score is normalized against `AdaptivePollingMaxInterval` (default 5 minutes). Each monitor computes priority and Scheduler Health scores from its own local timestamp rather than the process-wide Prometheus series, so a same-named connection on another monitor cannot mask a stale poll.
|
||||
|
||||
The scheduler applies **Exponential Smoothing** (alpha 0.6) and a small jitter (5%) to avoid oscillation.
|
||||
|
||||
@@ -98,18 +98,22 @@ lighter but predictable load, raise the polling intervals instead: freshness and
|
||||
offline detection then scale with the interval you choose.
|
||||
|
||||
## 📊 Metrics
|
||||
The separate metrics listener defaults to port 9091; `METRICS_PORT` can override
|
||||
it. Use an existing authorised scrape if available, not a newly exposed port for
|
||||
diagnostics. A missing scrape is not evidence of zero errors.
|
||||
The separate Prometheus metrics listener binds to `127.0.0.1:9091` by default. `PULSE_METRICS_PORT` overrides the port (with legacy `METRICS_PORT` accepted as a fallback when `PULSE_METRICS_PORT` is unset), `PULSE_METRICS_BIND_ADDRESS` overrides the bind address, and `PULSE_METRICS_TOKEN` enables bearer-token protection. See [Prometheus Metrics](PROMETHEUS_METRICS.md) for the full configuration and remote-scrape rules. Use an existing authorised scrape if available, not a newly exposed port for diagnostics. A missing scrape is not evidence of zero errors.
|
||||
|
||||
| Metric | Type | Description |
|
||||
| :--- | :--- | :--- |
|
||||
| `pulse_monitor_poll_total` | Counter | Recorded poll outcomes, split by result. |
|
||||
| `pulse_monitor_poll_duration_seconds` | Histogram | Poll latency. |
|
||||
| `pulse_monitor_poll_staleness_seconds` | Gauge | Age since the last success. Older builds update it only when a result is recorded. |
|
||||
| `pulse_monitor_poll_queue_depth` | Gauge | Total number of tasks still queued at scrape time. |
|
||||
| `pulse_monitor_poll_last_success_timestamp` | Gauge | Unix timestamp of the latest successful completion, paired with staleness on the same scrape snapshot. |
|
||||
| `pulse_monitor_poll_staleness_seconds` | Gauge | Age since the latest successful completion at scrape time (`-1` after a failure before the first success). Older builds update it only when a result is recorded. |
|
||||
| `pulse_monitor_poll_queue_depth` | Gauge | Total number of tasks still queued across running schedulers at scrape time. |
|
||||
| `pulse_monitor_poll_errors_total` | Counter | Error counts by category. |
|
||||
| `pulse_scheduler_queue_due_soon` | Gauge | Tasks still queued that are due now or within 12 seconds at scrape time. Older builds report the last recorded queue sample. |
|
||||
| `pulse_scheduler_queue_due_soon` | Gauge | Tasks still queued across running schedulers that are due now or within 12 seconds at scrape time. Older builds report the last recorded queue sample. |
|
||||
| `pulse_scheduler_queued_poll_overdue_seconds` | Gauge | Seconds past scheduled time for the most overdue timestamped poll still queued across running schedulers. |
|
||||
| `pulse_scheduler_claimed_poll_overdue_seconds` | Gauge | Seconds past one poll task timeout for the most overdue claimed poll, split by `waiting_for_slot` and `running` stages. |
|
||||
| `pulse_scheduler_dead_letter_depth` | Gauge | Terminal poll entries parked in running schedulers at scrape time. Cleared or retired label sets report zero for up to five minutes, then expire from the scrape. |
|
||||
|
||||
Stopped or replaced schedulers drop out of the live queue and dead-letter gauges, while any worker still holding a claimed poll remains visible in `pulse_scheduler_claimed_poll_overdue_seconds` until it returns. Delayed older poll results still increment `pulse_monitor_poll_total` without moving the latest completion timestamp or staleness age backwards.
|
||||
|
||||
If a scrape still works but polling stops producing results, use the
|
||||
[last-success timestamp](PROMETHEUS_METRICS.md#check-whether-polling-is-still-running)
|
||||
|
||||
@@ -29,11 +29,13 @@ Patrol mode sets how far Pulse can go when Patrol finds something that needs att
|
||||
| **Safe auto-fix** | `assisted` | Yes | Yes | Execute automatically | Approval required | Pro / legacy Pro+ / Cloud |
|
||||
| **Autopilot** | `full` | Yes | Yes | Execute automatically | Execute automatically | Pro / legacy Pro+ / Cloud |
|
||||
|
||||
- **Watch only**: Patrol creates findings but takes no action. This is the Community and Relay baseline and the default without Pro. Suitable for learning what Patrol detects before enabling investigation or fix execution.
|
||||
- **Watch only**: Patrol creates findings but takes no action. This is the Community baseline and the default without Pro. Suitable for learning what Patrol detects before enabling investigation or fix execution.
|
||||
- **Ask first** (Pro and above): Patrol investigates findings and proposes fixes. All fixes queue for manual approval before execution.
|
||||
- **Safe auto-fix** (Pro and above): Warning-level safe fix plans can execute automatically. Critical findings still require approval. This is the recommended starting point for most Pro and legacy Pro+ users who enable fix execution.
|
||||
- **Autopilot** (Pro and above): Safe fix plans can execute without approval. Activation requires an explicit human-session acknowledgement and a Pro, legacy Pro+, or Cloud license. Recommended only for environments with thorough alert coverage.
|
||||
|
||||
Relay is no longer sold, and Pulse Mobile and Relay retire on 31 March 2027. Continuing Relay subscribers receive Pro entitlements, including Pro Patrol modes, at their current price while their subscription continues.
|
||||
|
||||
On Pro, an install that has never chosen a mode runs **Ask first**, so new warning and critical findings are investigated without an extra step. Until you choose, the Patrol page explains this and offers to keep Ask first or switch to Watch only; either choice is saved and the notice goes away. Investigations use your AI provider and count toward the 30-day budget. A mode you have saved, including Watch only, is never changed.
|
||||
|
||||
### Configuration
|
||||
@@ -89,8 +91,8 @@ licence and policy enforcement still apply.
|
||||
|
||||
### License Requirements
|
||||
|
||||
- `monitor`: Available on all plans. Community and Relay can run Patrol with BYOK.
|
||||
- `approval`, `assisted`, and `full`: Require the `ai_autofix` capability (Pro, legacy Pro+, or Cloud license).
|
||||
- `monitor`: Available on all plans. Community installs can run Patrol in Watch only mode with BYOK.
|
||||
- `approval`, `assisted`, and `full`: Require the `ai_autofix` capability (Pro, continuing Relay, legacy Pro+, or Cloud license).
|
||||
|
||||
Without the `ai_autofix` capability, the effective Patrol mode is clamped to `monitor` at runtime, regardless of the saved configuration. If you previously had a Pro license and downgraded, your saved setting is preserved but enforcement reverts to `monitor`.
|
||||
|
||||
@@ -155,12 +157,12 @@ JSON
|
||||
|
||||
When Patrol mode is `approval`, `assisted`, or `full`, Patrol investigates findings. These parameters tune investigation behavior:
|
||||
|
||||
| Setting | Default | Range | Description |
|
||||
|---------|---------|-------|-------------|
|
||||
| `patrol_investigation_budget` | 10 | 5–30 | Maximum evidence-tool calls per investigation; Patrol derives a separate model-response safety ceiling |
|
||||
| `patrol_investigation_timeout_sec` | 600 (1500 for subscription CLIs) | 60–1800 | Maximum seconds per investigation. Subscription agent CLIs (`codex-subscription`, `claude-subscription`) default to 1500 seconds (25 minutes) when unset. |
|
||||
| Stored config key | API field (`/api/ai/patrol/autonomy`) | Default | Range | Description |
|
||||
|---------|---------|---------|-------|-------------|
|
||||
| `patrol_investigation_budget` | `investigation_budget` | 10 | 5-30 | Maximum evidence-tool calls per investigation. Patrol derives a separate model-response safety ceiling. |
|
||||
| `patrol_investigation_timeout_sec` | `investigation_timeout_sec` | 600 (1500 for subscription CLIs) | 60-1800 | Maximum seconds per investigation. Subscription agent CLIs (`codex-subscription`, `claude-subscription`) default to 1500 seconds (25 minutes) when unset. |
|
||||
|
||||
The following limits are fixed and cannot be changed: up to 3 investigations run in parallel, up to 3 attempts per finding, a 1 hour cooldown before re-investigating a finding, and a shorter 10 minute cooldown after a timeout failure.
|
||||
The following limits are fixed in the runtime and cannot be changed: up to 3 investigations run in parallel (up to 64 additional findings can wait in memory for a free slot, prioritised critical-first), up to 3 attempts per finding, a 1 hour default cooldown between investigation attempts, a 20 minute cooldown after a failed fix or failed fix verification, and a 10 minute cooldown after a timed-out outcome. Runs that fail before producing a conclusion, are interrupted by a restart, or end with unknown fix verification carry no extra cooldown and wait for the next scheduled Patrol cycle.
|
||||
|
||||
---
|
||||
|
||||
@@ -210,24 +212,28 @@ For new deployments, gradually increase Patrol mode:
|
||||
|
||||
## Monitoring AI Activity
|
||||
|
||||
### Patrol Metrics
|
||||
### Prometheus Metrics
|
||||
|
||||
Prometheus counters (prefix `pulse_patrol_*`) track:
|
||||
- Patrol runs, findings, investigations, fixes
|
||||
- Fix outcomes (success, failure, verification status)
|
||||
- Circuit breaker trips
|
||||
Pulse does not export a `pulse_patrol_*` Prometheus metric family. On the separate Prometheus metrics listener (`docs/monitoring/PROMETHEUS_METRICS.md`), two metric families cover AI runtime guardrails and governed action outcomes:
|
||||
|
||||
- **AI loop and safety counters (`pulse_ai_*`):** `pulse_ai_agentic_iterations_total`, `pulse_ai_strict_resolution_block_total`, `pulse_ai_routing_mismatch_block_total`, and `pulse_ai_phantom_detected_total`
|
||||
- **Operational Trust action counters (`pulse_operational_trust_*`):** `pulse_operational_trust_action_offers_total` and `pulse_operational_trust_action_verification_total`
|
||||
|
||||
For Patrol run counts, finding investigation status, and provider circuit-breaker state, use the Patrol UI or the API endpoints below.
|
||||
|
||||
### Cost Tracking
|
||||
|
||||
Token usage and estimated costs are tracked per provider:
|
||||
- **UI:** Settings → Pulse Intelligence → Provider & Models → Provider Usage & Spend
|
||||
- **API:** `GET /api/ai/cost/summary`
|
||||
- Set monthly budget limits to cap spending
|
||||
- Set a 30-day budget limit (`30-day budget (USD)`) to flag spend over budget
|
||||
|
||||
### Investigation Status
|
||||
### Patrol and Circuit Status
|
||||
|
||||
- **API:** `GET /api/ai/patrol/findings` — List all findings with investigation status
|
||||
- **API:** `GET /api/ai/circuit/status` — Check circuit breaker state
|
||||
- **API:** `GET /api/ai/patrol/status` for current Patrol runtime status
|
||||
- **API:** `GET /api/ai/patrol/runs` for recent Patrol run history
|
||||
- **API:** `GET /api/ai/patrol/findings` for active findings and investigation status
|
||||
- **API:** `GET /api/ai/circuit/status` for AI provider circuit breaker state
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -339,5 +339,60 @@ class PublicDocsProsePunctuationTest(unittest.TestCase):
|
||||
)
|
||||
|
||||
|
||||
class AIAutonomyHelpDocsTest(unittest.TestCase):
|
||||
def test_prometheus_section_matches_exported_metrics_and_endpoints(self) -> None:
|
||||
doc = (ROOT / "docs/AI_AUTONOMY.md").read_text(encoding="utf-8")
|
||||
mirror = (ROOT / "frontend-modern/public/docs/AI_AUTONOMY.md").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
self.assertEqual(doc, mirror)
|
||||
self.assertNotIn("Prometheus counters (prefix `pulse_patrol_*`) track:", doc)
|
||||
self.assertIn(
|
||||
"Pulse does not export a `pulse_patrol_*` Prometheus metric family.",
|
||||
doc,
|
||||
)
|
||||
for metric in (
|
||||
"`pulse_ai_agentic_iterations_total`",
|
||||
"`pulse_ai_strict_resolution_block_total`",
|
||||
"`pulse_ai_routing_mismatch_block_total`",
|
||||
"`pulse_ai_phantom_detected_total`",
|
||||
"`pulse_operational_trust_action_offers_total`",
|
||||
"`pulse_operational_trust_action_verification_total`",
|
||||
):
|
||||
self.assertIn(metric, doc)
|
||||
for endpoint in (
|
||||
"`GET /api/ai/patrol/status`",
|
||||
"`GET /api/ai/patrol/runs`",
|
||||
"`GET /api/ai/patrol/findings`",
|
||||
"`GET /api/ai/circuit/status`",
|
||||
):
|
||||
self.assertIn(endpoint, doc)
|
||||
|
||||
def test_relay_entitlements_and_investigation_runtime_limits_match_code(self) -> None:
|
||||
normalized = " ".join(
|
||||
(ROOT / "docs/AI_AUTONOMY.md").read_text(encoding="utf-8").split()
|
||||
)
|
||||
self.assertNotIn("Community and Relay baseline", normalized)
|
||||
self.assertNotIn("Community and Relay can run Patrol with BYOK", normalized)
|
||||
self.assertIn(
|
||||
"Continuing Relay subscribers receive Pro entitlements",
|
||||
normalized,
|
||||
)
|
||||
self.assertIn("retire on 31 March 2027", normalized)
|
||||
self.assertIn(
|
||||
"Pro, continuing Relay, legacy Pro+, or Cloud license",
|
||||
normalized,
|
||||
)
|
||||
self.assertIn("`investigation_budget`", normalized)
|
||||
self.assertIn("`investigation_timeout_sec`", normalized)
|
||||
self.assertIn("up to 64 additional findings can wait in memory", normalized)
|
||||
self.assertIn(
|
||||
"20 minute cooldown after a failed fix or failed fix verification",
|
||||
normalized,
|
||||
)
|
||||
self.assertIn("10 minute cooldown after a timed-out outcome", normalized)
|
||||
self.assertIn("30-day budget (USD)", normalized)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -413,7 +413,26 @@ class SchedulerPollingDocsTest(unittest.TestCase):
|
||||
self.assertIn("ADAPTIVE_POLLING_ENABLED=false", text)
|
||||
self.assertIn("merely removing `true`", text)
|
||||
self.assertIn("interrupts monitoring and notifications", text)
|
||||
self.assertIn("not a monitoring-health verdict", (ROOT / "docs/monitoring/ADAPTIVE_POLLING.md").read_text())
|
||||
adaptive = (ROOT / "docs/monitoring/ADAPTIVE_POLLING.md").read_text()
|
||||
self.assertIn("not a monitoring-health verdict", adaptive)
|
||||
|
||||
def test_adaptive_polling_guide_matches_metrics_env_and_local_freshness_runtime(self):
|
||||
adaptive = " ".join((ROOT / "docs/monitoring/ADAPTIVE_POLLING.md").read_text().split())
|
||||
for expected in (
|
||||
"`PULSE_METRICS_PORT`",
|
||||
"legacy `METRICS_PORT`",
|
||||
"`PULSE_METRICS_BIND_ADDRESS`",
|
||||
"`PULSE_METRICS_TOKEN`",
|
||||
"`pulse_monitor_poll_last_success_timestamp`",
|
||||
"`pulse_scheduler_queued_poll_overdue_seconds`",
|
||||
"`pulse_scheduler_claimed_poll_overdue_seconds`",
|
||||
"`pulse_scheduler_dead_letter_depth`",
|
||||
"from its own local timestamp rather than the process-wide Prometheus series",
|
||||
"Stopped or replaced schedulers drop out of the live queue and dead-letter gauges",
|
||||
"report zero for up to five minutes, then expire from the scrape",
|
||||
"without moving the latest completion timestamp or staleness age backwards",
|
||||
):
|
||||
self.assertIn(expected, adaptive)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user