Skip to content

Telemetry: http.requests rollup #907

@EhabY

Description

@EhabY

Part of the Telemetry Phase A rollout. See the RFC in Linear: AIGOV-154.

Aggregate HTTP traffic from the existing httpLogger.ts interceptor into periodic rollup events so we capture per-route health without emitting one event per request.

Event

  • http.requests with properties method, route, and measurements window_seconds, count_2xx, count_3xx, count_4xx, count_5xx, count_network_error, avg_duration_ms, p95_duration_ms.
  • One event per active (method, route) bucket at the end of each tumbling window. Default window is 60 seconds, configurable.
  • Quiet buckets (no requests in the window) are not emitted.

Normalization

  • Strip query strings.
  • Replace UUIDs and numeric IDs with {id}.
  • Replace user and workspace names with {name}.
  • Keep the normalization table alongside the aggregator so it's easy to update as routes change.

Privacy

  • No bodies, no headers, no raw URLs. This keeps each rollup near the same size as other events and avoids PII concerns.

Site

  • Hook into the existing axios interceptor in src/logging/httpLogger.ts rather than introducing a parallel one.

Tests

  • Several requests against the same (method, route) roll up into a single event at window end.
  • Different status codes land in the right count_2xx / count_4xx / etc. buckets.
  • Empty window produces no events.
  • p95 calculation matches a simple sorted-array reference on a known sample.
  • Route normalization maps /api/v2/workspaces/abc-123 to /api/v2/workspaces/{id} and /api/v2/users/danny/workspaces to /api/v2/users/{name}/workspaces.

Depends on AIGOV-243.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions