Skip to content

feat(telemetry): roll up http requests#946

Open
EhabY wants to merge 2 commits intomainfrom
feat/issue-907-http-requests-rollup
Open

feat(telemetry): roll up http requests#946
EhabY wants to merge 2 commits intomainfrom
feat/issue-907-http-requests-rollup

Conversation

@EhabY
Copy link
Copy Markdown
Collaborator

@EhabY EhabY commented May 8, 2026

Summary

  • Add http.requests telemetry rollups for active (method, route) buckets from the existing axios logging interceptor path.
  • Normalize routes to strip queries and replace IDs/user/workspace names before telemetry emission.
  • Add coder.telemetry.local.httpRequests.windowSeconds as an advanced JSON setting with a 60s default.
  • Wire telemetry into the primary and remote-scoped CoderApi clients while keeping throwaway clients opt-in.

Closes #907.

Validation

  • pnpm test:extension ./test/unit/settings/telemetry.test.ts ./test/unit/logging/httpRequestsTelemetry.test.ts ./test/unit/api/coderApi.test.ts
  • pnpm test:extension
  • pnpm format:check
  • pnpm lint
  • pnpm typecheck
Implementation plan and decisions

Decisions

  1. coder.telemetry.local is treated as advanced local telemetry runtime configuration, not just local sink configuration.
  2. The HTTP rollup setting lives at coder.telemetry.local.httpRequests.windowSeconds with a default of 60.
  3. Throwaway CoderApi instances remain telemetry-free by default; long-lived primary and remote-scoped API clients receive telemetry.
  4. HTTP aggregation hooks into the existing axios logging interceptor path rather than adding a parallel interceptor.
  5. Route normalization rules are kept alongside the aggregator for easy route maintenance.

Implementation

  • Added HttpRequestsTelemetry for tumbling-window aggregation and http.requests emission.
  • Added per-route normalization for IDs, numeric segments, user names, and workspace names.
  • Added a small TelemetryReporter interface/no-op reporter to decouple CoderApi from concrete telemetry service construction.
  • Extended coder.telemetry.local schema and runtime readers with httpRequests.windowSeconds.
  • Added tests for same-bucket rollup, status buckets, empty windows, p95, route normalization, settings parsing, and axios interceptor wiring.

Generated by Coder Agents.

@EhabY EhabY self-assigned this May 8, 2026
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.

Telemetry: http.requests rollup

1 participant