diff --git a/CHANGELOG.md b/CHANGELOG.md index 799601d..a9c0f50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## unreleased + +* [Try to get metrics provider from transport in setup_v2 if no metrics provider is passed](https://github.com/anna-money/aio-request/pull/280) + + ## v0.1.33 (2024-10-29) * [Only yarl >= 1.12 is supported](https://github.com/anna-money/aio-request/commit/1a443f2ec6637bbfb86b717ac03b56a3ff0650b8) diff --git a/aio_request/setup.py b/aio_request/setup.py index bbe34b4..965b01f 100644 --- a/aio_request/setup.py +++ b/aio_request/setup.py @@ -79,6 +79,7 @@ def setup_v2( raise ValueError("Either endpoint or endpoint_provider must be provided") if endpoint is not MISSING and endpoint_provider is not MISSING: raise ValueError("Only one of endpoint or endpoint_provider must be provided") + metrics_provider = metrics_provider or getattr(transport, "_metrics_provider", None) request_strategy = MethodBasedStrategy( {