Skip to content

Feature Request: Emit requestFinished Event for Per-Request Bandwidth Tracking #589

@shresthaoshan

Description

@shresthaoshan

Currently, the library emits a connectionClosed event, which is helpful for tracking the overall bandwidth usage of a socket connection. However, in many real-world scenarios involving persistent connections (e.g., HTTP keep-alive), it's valuable to monitor bandwidth usage on a per-request basis.

Feature Request

I’d like to propose adding support for a new event, requestFinished, which would be emitted at the end of each individual HTTP/HTTPS request-response cycle.

While precise per-request bandwidth usage may not be trivial to isolate due to socket reuse, this event would still provide:

  • A time-based approximation of bandwidth usage across requests.
  • Insight into request frequency, response size patterns, and endpoint behavior.
  • A hook for logging, monitoring, or quota management per request.

Why This Matters

Tracking only at the socket level can obscure usage spikes or performance anomalies associated with individual requests—especially under connection pooling or when clients reuse a single proxy connection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomers.medium priorityMedium priority issues to be done in a couple of sprints.product enhancementFeatures improving the product.t-core-servicesIssues with this label are in the ownership of the core services team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions