Skip to content

Add request metrics hooks #121

Open
Open

Description

@aram356

Description

Expose request-count, latency and error observations so applications can track volume, latency percentiles and error rate.

Current middleware records formatted request logs; no public metrics hook/observer abstraction is exported. KV timing logs measure store operations, not request metric aggregation.

Steps to reproduce

  1. Inspect core middleware and module exports for a metrics observer.
  2. Compare request log output with count, duration-distribution and error observations needed by a metrics backend.

Expected behavior

Applications can attach a metrics backend to reusable request observations without replacing request handling.

Impact

Applications must implement timing/count/error hooks independently before exporting request metrics.

Proposed fix

Define a portable request-observation hook with bounded labels and explicit completion/error boundaries; leave backend aggregation/export and percentiles to the selected metrics integration.

Done when

  • Hooks expose request count, duration and outcome/error facts.
  • Route/method/status labels and unmatched/error behavior are defined.
  • A backend example derives request rate, error rate and latency percentiles.
  • Hooks respect the portable runtime boundary and avoid unbounded per-request label state.

Related

Activity

  1. changed the title [-]Metrics hooks[/-] [+]Add request metrics hooks[/+] on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions