Skip to content

feat(observability): configurable health probes, incident timelines, trace propagation, and parser alerting - #1285

Merged
mijinummi merged 1 commit into
MDTechLabs:mainfrom
adeniran19-maker:feat/batch-1262-1263-1265-1266
Oct 20, 2026
Merged

mijinummi merged 1 commit into
MDTechLabs:mainfrom
adeniran19-maker:feat/batch-1262-1263-1265-1266

Conversation

@adeniran19-maker

Copy link
Copy Markdown
Contributor

Summary

This pull request implements four key operations and observability features across GasGuard's platform:

  1. Configurable Health Probe Thresholds (Closes Add configurable health probe thresholds #1266):

    • Adds HealthProbe and HealthProbeRegistry supporting tunable latency thresholds (healthyLatencyMsThreshold, degradedLatencyMsThreshold, unhealthyLatencyMsThreshold), consecutive failure/success counts, and sliding window failure rates.
    • Replaces binary alive/dead health checks with three-state status evaluation (healthy, degraded, unhealthy).
    • Automatically sanitizes probe target URLs, redacting API keys, passwords, and tokens.
    • Comprehensive unit and integration test coverage (libs/monitoring/health-probe.spec.ts).
    • Documentation in docs/HEALTH_PROBE_THRESHOLDS.md.
  2. Incident Timeline Export for Failed Scans (Closes Create incident timeline export for failed scans #1265):

    • Implements structured chronological incident tracking (IncidentTimelineStore and IncidentTimelineExportService) capturing events across scan lifecycles (queueing, lease acquisition, worker assignment, parsing, analyzer execution, resource alarms, and worker crashes).
    • Strict tenant isolation and bounded memory management (maxIncidentsPerTenant, maxEventsPerIncident).
    • Multi-format exports: Canonical JSON, Markdown post-mortem reports, and RFC 4180 CSV tables.
    • Secret sanitization redacting private keys (0x[a-fA-F0-9]{64}), bearer tokens, and credentials.
    • Unit and concurrency integration tests (apps/api/src/exports/incident-timeline/).
    • Documentation in docs/INCIDENT_TIMELINE_EXPORT.md.
  3. Distributed Trace Propagation Across API and Workers (Closes Implement trace propagation across API and workers #1263):

    • Compliant with W3C Trace Context Level 1 standard (traceparent, tracestate, and baggage).
    • Header extraction/injection for API gateways (extractFromHttpHeaders, injectIntoHttpHeaders).
    • Queue job envelope carrier (injectIntoJobEnvelope, extractFromJobEnvelope) for BullMQ and background workers.
    • AsyncLocalStorage-based active context tracking (runWithContext, startSpan, endSpan).
    • Comprehensive unit and integration tests (apps/api/src/common/tracing/).
    • Documentation in docs/TRACE_PROPAGATION.md.
  4. Alerting for Repeated Parser Failures (Closes Add alerting for repeated parser failures #1262):

    • Adds ParserFailureAlertTracker and ParserFailureAlertService to track AST parsing errors across Solidity, Vyper, and Soroban repositories under strict tenant isolation.
    • Configurable alert criteria: consecutive failures threshold, sliding window failure ratio, cooldown suppression to prevent notification floods, and auto-resolution after consecutive successes.
    • Zero code leakage: aggregates structured diagnostic codes without storing or logging contract source code.
    • Unit tests, integration tests, realistic DeFi repository fixture, and deterministic regression snapshot fixture (apps/api/src/scanner/parser-alerting/).
    • Documentation in docs/PARSER_FAILURE_ALERTING.md.

Issues Addressed

Verification

  • libs/monitoring/health-probe.spec.ts: 26 tests passed
  • apps/api/src/exports/incident-timeline/: 12 tests passed
  • apps/api/src/common/tracing/: 15 tests passed
  • apps/api/src/scanner/parser-alerting/: 13 tests passed
  • Total 66 new tests passed with 100% success.
  • ESLint and Prettier verified with 0 errors.

…trace propagation, and parser alerting

- Add configurable health probe thresholds for subsystem health evaluation (healthy, degraded, unhealthy), latency thresholds, consecutive failure/success counts, and sliding window failure rates (MDTechLabs#1266).
- Create incident timeline export for failed scans across JSON, Markdown post-mortem reports, and RFC 4180 CSV with tenant isolation, concurrency resilience, and secret sanitization (MDTechLabs#1265).
- Implement distributed trace propagation across API gateways and background workers complying with W3C Trace Context (traceparent, tracestate, baggage) and AsyncLocalStorage context scope (MDTechLabs#1263).
- Add automated alerting for repeated AST parser failures across repositories with deterministic tracking, cooldown suppression, severity escalation, and auto-resolution (MDTechLabs#1262).

Closes MDTechLabs#1262
Closes MDTechLabs#1263
Closes MDTechLabs#1265
Closes MDTechLabs#1266
@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@adeniran19-maker 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! 🚀

Learn more about application limits

@mijinummi
mijinummi merged commit 89ee3c9 into MDTechLabs:main Oct 20, 2026
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants