Add new option bypassOnFinish, for when response is required in bypass callback

This commit is contained in:
Henrik Karlsson
2022-12-09 17:19:10 +01:00
parent 93b0e8fafe
commit ea9f34aa3e
4 changed files with 44 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ Which labels to include in `http_request_duration_seconds` metric:
* **metricsPath**: replace the `/metrics` route with a **regex** or exact **string**. Note: it is highly recommended to just stick to the default
* **metricType**: histogram/summary selection. See more details below
* **bypass**: function taking express request as an argument and determines whether the given request should be excluded in the metrics, default: **() => false**
* **bypassOnFinish**: function taking express request and response as arguments and determines whether the given request should be excluded in the metrics, default: **() => false**. Prefer using **bypass** if you don't need the response object.
* **httpDurationMetricName**: Allows you change the name of HTTP duration metric, default: **`http_request_duration_seconds`**.
### metricType option ###