mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 10:33:40 +01:00
Document full Scheduler Health deadLetter fields in API and Help docs (#5778)
Align the GET /api/monitoring/scheduler/health instances[].deadLetter section in docs/API.md and its shipped in-app Help mirror (frontend-modern/public/docs/API.md) with InstanceDLQ in internal/monitoring/monitor.go. Include firstAttempt, lastAttempt and retryCount alongside present, reason and nextRetry, explain comparing lastAttempt and retryCount across two snapshots so a retained parked entry is not mistaken for a new terminal failure, and note that a partial read can clear the dead-letter entry while leaving pollStatus.lastError with category partial. Add a source-bound regression test in scripts/tests/test_scheduler_polling_docs.py. Contract-Neutral: Documentation and docs-contract test update only, with no Pulse runtime, API, metric export or configuration behaviour changes. --- Fleet candidate `20261203T082150Z-product-intelligence` from the `product-intelligence` lane. Reviewed tip `58033e5d6a616df8fecbb29b41ff7980b0552992` on `main`. [How Pulse handles triage](https://github.com/rcourtman/Pulse/blob/main/docs/AI_TRANSPARENCY.md)
This commit is contained in:
10
docs/API.md
10
docs/API.md
@@ -1731,9 +1731,13 @@ poll interval:
|
||||
breakers outside the default `closed`/zero-failure state.
|
||||
- **`instances[].deadLetter` and `deadLetter`**: `deadLetter.count` and up to
|
||||
25 `tasks` summarise terminal poll entries. Each instance entry exposes
|
||||
`present`, `reason` and `nextRetry`. `nextRetry` does not schedule a poll. A
|
||||
later successful scheduled poll clears the dead-letter entry on current
|
||||
builds, though older builds may retain it after recovery.
|
||||
`present`, `reason`, `firstAttempt`, `lastAttempt`, `retryCount` and
|
||||
`nextRetry`. `nextRetry` does not schedule a poll. Compare `lastAttempt` and
|
||||
`retryCount` across two snapshots so a retained parked entry is not mistaken
|
||||
for a new terminal failure. A later successful scheduled poll clears the
|
||||
dead-letter entry on current builds, though older builds may retain it after
|
||||
recovery. A partial read can clear that entry while still leaving
|
||||
`pollStatus.lastError` with category `partial`.
|
||||
- **`staleness`**: Per-connection freshness entries (`instance`, `type`,
|
||||
`score`, `lastSuccess`, and optional `lastError`) computed locally inside
|
||||
this monitor. Each `score` ages from `0` right after a successful poll up to
|
||||
|
||||
@@ -1731,9 +1731,13 @@ poll interval:
|
||||
breakers outside the default `closed`/zero-failure state.
|
||||
- **`instances[].deadLetter` and `deadLetter`**: `deadLetter.count` and up to
|
||||
25 `tasks` summarise terminal poll entries. Each instance entry exposes
|
||||
`present`, `reason` and `nextRetry`. `nextRetry` does not schedule a poll. A
|
||||
later successful scheduled poll clears the dead-letter entry on current
|
||||
builds, though older builds may retain it after recovery.
|
||||
`present`, `reason`, `firstAttempt`, `lastAttempt`, `retryCount` and
|
||||
`nextRetry`. `nextRetry` does not schedule a poll. Compare `lastAttempt` and
|
||||
`retryCount` across two snapshots so a retained parked entry is not mistaken
|
||||
for a new terminal failure. A later successful scheduled poll clears the
|
||||
dead-letter entry on current builds, though older builds may retain it after
|
||||
recovery. A partial read can clear that entry while still leaving
|
||||
`pollStatus.lastError` with category `partial`.
|
||||
- **`staleness`**: Per-connection freshness entries (`instance`, `type`,
|
||||
`score`, `lastSuccess`, and optional `lastError`) computed locally inside
|
||||
this monitor. Each `score` ages from `0` right after a successful poll up to
|
||||
|
||||
@@ -664,6 +664,33 @@ class SchedulerPollingDocsTest(unittest.TestCase):
|
||||
rollout,
|
||||
)
|
||||
|
||||
def test_api_docs_document_full_scheduler_dead_letter_fields(self) -> None:
|
||||
monitor_src = (ROOT / "internal/monitoring/monitor.go").read_text()
|
||||
for field in (
|
||||
'Present bool `json:"present"`',
|
||||
'Reason string `json:"reason,omitempty"`',
|
||||
'FirstAttempt *time.Time `json:"firstAttempt,omitempty"`',
|
||||
'LastAttempt *time.Time `json:"lastAttempt,omitempty"`',
|
||||
'RetryCount int `json:"retryCount,omitempty"`',
|
||||
'NextRetry *time.Time `json:"nextRetry,omitempty"`',
|
||||
):
|
||||
self.assertIn(field, monitor_src)
|
||||
|
||||
api_doc = (ROOT / "docs/API.md").read_text()
|
||||
help_api_doc = (ROOT / "frontend-modern/public/docs/API.md").read_text()
|
||||
self.assertEqual(api_doc, help_api_doc)
|
||||
|
||||
for expected in (
|
||||
"`present`, `reason`, `firstAttempt`, `lastAttempt`, `retryCount` and",
|
||||
"`nextRetry`",
|
||||
"Compare `lastAttempt` and",
|
||||
"`retryCount` across two snapshots so a retained parked entry is not mistaken",
|
||||
"for a new terminal failure.",
|
||||
"A partial read can clear that entry while still leaving",
|
||||
"`pollStatus.lastError` with category `partial`.",
|
||||
):
|
||||
self.assertIn(expected, api_doc)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user