From 16ebf2519b6e5f5762d359e4da3ae8b445227690 Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Tue, 26 Nov 2024 22:46:47 +0100 Subject: [PATCH] starlette: Replace `_meter_provider` by `meter_provider` on `_instrument` (#3048) * starlette: Replace `_meter_provider` by `meter_provider` on `_instrument` * Add PR on the changelog --------- Co-authored-by: Riccardo Magliocchetti --- CHANGELOG.md | 2 ++ .../src/opentelemetry/instrumentation/starlette/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b194cd8b9a..e6cb0ebb53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `opentelemetry-instrumentation-starlette`: Retrieve `meter_provider` key instead of `_meter_provider` on `_instrument` + ([#3048](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3048)) - `opentelemetry-instrumentation-httpx`: instrument_client is a static method again ([#3003](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3003)) - `opentelemetry-instrumentation-system_metrics`: fix callbacks reading wrong config diff --git a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py index 50d2fb03d8..820fa29411 100644 --- a/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-starlette/src/opentelemetry/instrumentation/starlette/__init__.py @@ -265,7 +265,7 @@ def _instrument(self, **kwargs): _InstrumentedStarlette._client_response_hook = kwargs.get( "client_response_hook" ) - _InstrumentedStarlette._meter_provider = kwargs.get("_meter_provider") + _InstrumentedStarlette._meter_provider = kwargs.get("meter_provider") applications.Starlette = _InstrumentedStarlette