From 9bb8032bde560a9700868a7427383774d2a229b8 Mon Sep 17 00:00:00 2001 From: Tim Schwenke Date: Mon, 20 Mar 2023 00:27:04 +0100 Subject: [PATCH] chore: Update --- CHANGELOG.md | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62c7a55..153bc51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,15 +9,28 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0). ### Changed -- **BREAKING:** Moved passing response body to instrumentation functions behind - feature flag / whitelist that is empty by default. This changes a feature - introduced with `5.10.0` and affects users that have custom instrumentation - functions accessing `info.response.body`. - - Opt-in via new parameter `body_handlers` added to instrumentator and - middleware constructors. Parameter expects list of pattern strings to match - handlers. To keep the old behavior, pass the argument `[r".*"]` to match all - handlers. +- **BREAKING:** Disabled passing response body to instrumentation functions. + Moved behind whitelist that is empty by default. Changes a feature introduced + with [5.10.0](#5100--2023-02-26). Only affects users that have custom + instrumentations that access `info.response.body`. + + Opt-in via new parameter `body_handlers` added to instrumentator constructor. + Parameter takes list of pattern strings to match handlers. For old behavior, + pass argument `[r".*"]` to match all handlers: + + ```python + instrumentator = Instrumentator(body_handlers=[r".*"]) + ``` + + Motivation for change: Collecting body negatively impacts performance of + responses with largish body. + + Thanks to [@bbeattie-phxlabs](@bbeattie-phxlabs) for raising this issue in + [#234](https://github.com/trallnag/prometheus-fastapi-instrumentator/issues/234) + and implementing it in + [#233](https://github.com/trallnag/prometheus-fastapi-instrumentator/pull/233) + / + [#238](https://github.com/trallnag/prometheus-fastapi-instrumentator/pull/238). ## [5.11.2](https://github.com/trallnag/prometheus-fastapi-instrumentator/compare/v5.11.1...v5.11.2) / 2023-03-19