Feat/health dependency latency age budgets 1228 - #1266
Open
dorismaduegbunam wants to merge 5 commits into
Open
Conversation
…1228) Extend the live health subsystem to surface per-probe freshness on top of availability and latency: - ProbeResult gains optional ageMs/lastSuccessfulAt so consumers can see how stale each dependency's data is. - HealthBudget (maxLatencyMs, maxAgeMs) with a DEFAULT_HEALTH_BUDGET bounds probe runtime and degrades probes whose data is older than the budget instead of reporting them up. - runHealthCheck clamps probe latency (timeouts count as down) and applies the freshness budget. - New indexerProbe reads the latest indexed event timestamp from smart_contract_events so indexer freshness is observable. - Production/verbose health responses include ageMs and lastSuccessfulAt for healthy probes; detail remains stripped in non-verbose mode. - docs/health.md updated with the new budget and freshness semantics.
The baseline suite carried breakage from several merged PRs that shipped ahead of a green test run. Restore it: - safeErrors/appError: fix mangled identifiers, corrupted transport-timeout regexes, and the SQL statement regex so error classification matches intent (Talenttrust#1236). - contractsClient: correct mangled identifiers (RETRYABLE_KINDS, maxDelayMs, delayMs, classified); make upstreamHttpClient preserve failure diagnostics (transport code, HTTP status, headers, response body) on DependencyError so failure classification and Retry-After honored actually work (Talenttrust#1236); align mis-matched classification tests with the merged enum/API. - middleware/eventIngestion: fix imports of the nonexistent ../context module to ../middleware/requestContext (Talenttrust#1237). - db: restore the dropped add_transaction_lease_columns migration as version 16 (the version-14 slot was taken by api_keys when two PRs collided, so SqliteTransactionStore lease queries failed with 'no such column') (Talenttrust#1241 Talenttrust#1240). - blockchain-processor: restore lost defaultFinalityPromoter definition and eventAuditService import (Talenttrust#1245). - address.validation.test / reputation.api.test: regenerate corrupted VALID_ACCOUNT constant and add missing controller mocks. - rate-limit tests: update window-reset tests to the sliding-window semantics from Talenttrust#1201 (previous bucket still counts until it leaves the trailing window). - dlqStore: fix db:: typo.
|
@dorismaduegbunam Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Extends the live health subsystem so each probe surfaces how fresh the dependency's data is, alongside availability and latency, and lets operators set budgets for both metrics.
Changes
ageMsandlastSuccessfulAtin addition tookandlatencyMs.HealthBudget(maxLatencyMs,maxAgeMs) bounds how long a probe may run and how old its data may be before the dependency is reported as degraded, instead of healthy.runHealthCheckclamps probe latency (a probe that times out is reported as down) and apples the freshness budget after each probe.Security
Test suite
npm run lint(0 errors) andnpm run buildpass.This branch also ships a dedicated commit repairing pre-existing regressions from earlier merged PRs that were failing on
mainbefore this work (mangled identifiers, a dropped schema migration, and rate-limit tests left stale by a limiter rewrite), so the branch lands on a fully green baseline.Closes #1228