HomePhabricator
Diffusion Comm 91b40f4fe0bc

[keyserver] Introduce `logEndpointMetrics` and `yarn dev-log-metrics`

Tags
None
Referenced Files
F777289: dc3255.png
Sep 27 2023, 4:23 PM
File Not Attached
Subscribers
None

Description

[keyserver] Introduce logEndpointMetrics and yarn dev-log-metrics

Summary:
Introduce logEndpointMetrics middleware (on Express middleware: https://expressjs.com/en/guide/using-middleware.html) to log request-response duration and Content-Length for each endpoint.

This middleware is enabled when KEYSERVER_ENDPOINT_METRICS_ENABLED is set.

Will introduce a separate yarn command to write logs to disk

Test Plan:
Logs look as expected when KEYSERVER_ENDPOINT_METRICS_ENABLED is set:

dc3255.png (1×1 px, 517 KB)

Logs don't appear when KEYSERVER_ENDPOINT_METRICS_ENABLED is unset.

Reviewers: ashoat, ginsu, tomek, rohan

Reviewed By: ashoat

Differential Revision: https://phab.comm.dev/D9308

Details

Provenance
atulAuthored on Sep 27 2023, 12:39 PM
Reviewer
ashoat
Differential Revision
D9308: [keyserver] Introduce `logEndpointMetrics` and `yarn dev-log-metrics`
Parents
rCOMM0a18f121e40b: [keyserver] Compress HTTP responses
Branches
Unknown
Tags
Unknown