Skip to content

Analytics: add request-log retention and rate-based write coalescing #1296

Description

@nanaf6203-bit

Context

src/analytics/analytics.interceptor.ts + service record RequestLog per request (createMany in a time window, per spec) with no retention.

Problem

As the analytics interceptor applies to every HTTP request, RequestLog grows at request volume; pruning is absent (CleanupService gap) and burst writes still queue. Analytics data becomes a storage and maybe compliance liability.

Proposed approach

Add RequestLog retention to CleanupService (CLEANUP_REQUESTLOG_DAYS), coalesce writes to Redis buffers with a flush cron, and surface write-failure rates in metrics.

Acceptance criteria

  • RequestLog is bounded; interceptor: no DB strain at peak traffic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions