Skip to content

feat: add Heimdall telemetry system with async logging, analytics, and zero-loss guarantee#61

Open
cto-new[bot] wants to merge 1 commit into
mainfrom
feat/heimdall-telemetry-wire
Open

feat: add Heimdall telemetry system with async logging, analytics, and zero-loss guarantee#61
cto-new[bot] wants to merge 1 commit into
mainfrom
feat/heimdall-telemetry-wire

Conversation

@cto-new

@cto-new cto-new Bot commented Nov 6, 2025

Copy link
Copy Markdown

Summary

This PR implements the Heimdall telemetry system for secure, async API request logging, advanced analytics, and zero-loss guarantees. All request metadata is collected, sanitized, and persisted to dedicated logging storage without blocking the main request flow.

Details

  • Adds HeimdallRequestLog model and migrations for structured telemetry data.
  • Introduces async middleware and buffered worker pool for non-blocking persistence.
  • Implements disk queue fallback for zero-loss and graceful DB outage handling.
  • Extracts validated metadata from whitelisted headers with IP normalization/XSS defense.
  • Tracks per-URL, per-token, and per-user frequency in Redis and rolls up hourly stats.
  • Provides service layer for anomaly analysis, frequency analytics, and dashboard views.
  • Exposes REST endpoints with User/Admin distinction for metrics/config/rollups.
  • Includes comprehensive unit/integration tests for extraction, persistence, and fallback.
  • Fully documented (README), with .env example for configuration and security best practices.

Warning: Task VM test is not passing, cto.new will perform much better if you fix the setup

…ogging

Introduce Heimdall telemetry system to securely collect, persist, and analyze API request metadata with zero-loss guarantee. Change enables async, non-blocking request logging, Redis-based frequency analytics, and disk-backed fallback queue for robust persistence. Adds detailed middleware, model, service, and controller layer, with unit, integration, and fallback behavior tests.

- Needed for high-assurance request auditing, anomaly detection, and analytics
- Adds HeimdallRequestLog model, async worker, disk queue, and analytics endpoints
- Integrates whitelisted header parsing, sanitization, and frequency tracking
- Admin/config APIs for telemetry stats, dashboard, and rollups

Security: Auth fingerprinting, header sanitation, optional geo, cookies redaction
Docs: New usage guide, .env.example template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants