Skip to content

Commit

Permalink
Try to get metrics provider from transport in setup_v2 if no metrics …
Browse files Browse the repository at this point in the history
…provider is passed (#280)

* fixed BC in setup_v2 for metrics_provider

* Add to changelog

---------

Co-authored-by: Iurii Pliner <[email protected]>
  • Loading branch information
maradik and Pliner authored Nov 5, 2024
1 parent fd0d04c commit f9f792f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions aio_request/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down

0 comments on commit f9f792f

Please sign in to comment.