Merged
Conversation
103df57 to
3f339c3
Compare
xrmx
commented
Sep 13, 2024
instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py
Outdated
Show resolved
Hide resolved
854b02a to
4a8055f
Compare
…tadata from requiements
|
Tested out locally and it works for me. My benchmarks show a ~100-200ms improvement in the import/start time when manually configuring and ~400-500ms when using the auto-instrumentation. Thank you to everyone who contributed towards this change and I can't wait to see this land 🙌 |
emdneto
reviewed
Oct 17, 2024
instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py
Show resolved
Hide resolved
lzchen
reviewed
Oct 17, 2024
lzchen
approved these changes
Oct 17, 2024
tammy-baylis-swi
approved these changes
Oct 17, 2024
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
emdneto
approved these changes
Oct 18, 2024
This was referenced Oct 20, 2024
Closed
|
Do we know when this will make it into a release? Looks like there has not been a release since August, will one be coming soon? I see this in the CHANGELOG.md. It's blocking us from being able to go to python 3.12, so mostly just curious on timing. |
Contributor
Yes, this is now available as part of 1.28.1/0.49b1. |
xrmx
added a commit
to xrmx/opentelemetry-python-contrib
that referenced
this pull request
Jan 24, 2025
yiyuan-he
added a commit
to aws-observability/aws-otel-python-instrumentation
that referenced
this pull request
Jun 16, 2025
…Setup (#398) ## What does this pull request do? Fixes an issue where [upgrading](#388) our OTel dependency version from 1.27.0 caused all of our contract tests to start [failing](https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/15640951584/job/44067918087) in the main build. The root cause was that in version [1.28.0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.49b0) OpenTelemetry Python SDK migrated from `pkg_resources` to `importlib_metadata` for entry point discovery. This was a [breaking change](open-telemetry/opentelemetry-python-contrib#2871) that had significant behavioral implications: - **Before (pkg_resources):** Entry points were discovered in `sys.path` order, meaing packages installed in the local test environment (e.g. venv) were always prioritized. This made ADOT discovery predictable and consistent even without explicitly specifying `OTEL_PYTHON_DISTRO` and `OTEL_PYTHON_CONFIGURATOR` in the contract test set up. - **After (importlib_metadata):** Entry points are discovered using an implementation ordering that doesn't guarantee `sys.path` precedence. In short, the discovery order depends on factors like filesystem iteration order, installation timestamps, etc. - things that can vary between environments. This is why our contract tests were able to pass in original PR build to bump the OTel dependencies, but then started failing in our main build. Due to this unpredicatable ordering, our ADOT SDK was not able to instrument the sample apps in our contract tests correctly which then resulted in all the test assertions failing. The solution is to explicitly configure the OpenTelemetry distro and configurator in our contract test set up. This approach follows OpenTelemetry's [official recommendations](https://pypi.org/project/opentelemetry-instrumentation/) when multiple distros are present. > If you have entry points for multiple distros or configurators present in your environment, you should specify the entry point name of the distro and configurator you want to be used via the OTEL_PYTHON_DISTRO and OTEL_PYTHON_CONFIGURATOR environment variables. **This fix will enable us to safely upgrade our OTel dependency version from 1.27.0 which unblocks the Caton project.** By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
yiyuan-he
added a commit
to yiyuan-he/aws-otel-python-instrumentation
that referenced
this pull request
Jun 16, 2025
…Setup (aws-observability#398) ## What does this pull request do? Fixes an issue where [upgrading](aws-observability#388) our OTel dependency version from 1.27.0 caused all of our contract tests to start [failing](https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/15640951584/job/44067918087) in the main build. The root cause was that in version [1.28.0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.49b0) OpenTelemetry Python SDK migrated from `pkg_resources` to `importlib_metadata` for entry point discovery. This was a [breaking change](open-telemetry/opentelemetry-python-contrib#2871) that had significant behavioral implications: - **Before (pkg_resources):** Entry points were discovered in `sys.path` order, meaing packages installed in the local test environment (e.g. venv) were always prioritized. This made ADOT discovery predictable and consistent even without explicitly specifying `OTEL_PYTHON_DISTRO` and `OTEL_PYTHON_CONFIGURATOR` in the contract test set up. - **After (importlib_metadata):** Entry points are discovered using an implementation ordering that doesn't guarantee `sys.path` precedence. In short, the discovery order depends on factors like filesystem iteration order, installation timestamps, etc. - things that can vary between environments. This is why our contract tests were able to pass in original PR build to bump the OTel dependencies, but then started failing in our main build. Due to this unpredicatable ordering, our ADOT SDK was not able to instrument the sample apps in our contract tests correctly which then resulted in all the test assertions failing. The solution is to explicitly configure the OpenTelemetry distro and configurator in our contract test set up. This approach follows OpenTelemetry's [official recommendations](https://pypi.org/project/opentelemetry-instrumentation/) when multiple distros are present. > If you have entry points for multiple distros or configurators present in your environment, you should specify the entry point name of the distro and configurator you want to be used via the OTEL_PYTHON_DISTRO and OTEL_PYTHON_CONFIGURATOR environment variables. **This fix will enable us to safely upgrade our OTel dependency version from 1.27.0 which unblocks the Caton project.** By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This incorporates all previous work from @Rodrigo-Novas and @ocelotl and makes ci happy.
Fixes #2180
Fixes #1970
Fixes #2843
Closes #1973 #2124 #2181 #2854
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.