-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Teach fastapi instrumentation about fastapi-slim #2702
Conversation
.../opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py
Show resolved
Hide resolved
instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml
Outdated
Show resolved
Hide resolved
@xrmx Thanks for the review, always appreciate your quick reply and guidance! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I would just add a test requirements file with fastapi-slim installed so we check that we support that
I would not add new tox environment, just add a test requirement for the
current fastapi one
Il lun 15 lug 2024, 16:12 Emídio Neto ***@***.***> ha scritto:
… ***@***.**** commented on this pull request.
------------------------------
In tox.ini
<#2702 (comment)>
:
> @@ -548,6 +549,12 @@ commands_pre =
fastapi: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
fastapi: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
fastapi: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements.txt
+ fastapi-slim: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
+ fastapi-slim: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
+ fastapi-slim: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
+ fastapi-slim: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
+ fastapi-slim: pip install -r {toxinidir}/instrumentation/opentelemetry-instrumentation-fastapi/test-requirements-slim.txt
Are we missing running this on CI?
—
Reply to this email directly, view it on GitHub
<#2702 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAADFBCZYXIN3QPYWFSPV5LZMPKDHAVCNFSM6AAAAABKYX3OZSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCNZXHAZTIMBYGI>
.
You are receiving this because you were mentioned.Message ID:
<open-telemetry/opentelemetry-python-contrib/pull/2702/review/2177834082@
github.com>
|
instrumentation/opentelemetry-instrumentation-fastapi/pyproject.toml
Outdated
Show resolved
Hide resolved
Hey @xrmx, I think we should create a new tox environment for this. The issue is that FastAPI-Slim uses the same import statement as FastAPI (import fastapi). This means we can't just add a new test file under the current FastAPI environment and expect it to work correctly with FastAPI-Slim. To properly test FastAPI-Slim, we need to:
|
@zhihali So the issue is that fastapi and fastapi-slim does not conflict with each other and so installing one will not remove the other. Right? |
@xrmx But for now, I think we solve the OR problem, for AND, this is a bit complex.
So it's defo not recommand to use both fastapi and fastapi-slim(since the import all be What's your opinion? Any further discussion is welcomed! |
I was talking specifically to the inability to use the same tox environment, sorry for not being more clear. PR is fine for me |
Co-authored-by: Riccardo Magliocchetti <[email protected]>
Co-authored-by: Riccardo Magliocchetti <[email protected]>
Description
Fixes #2683
Type of change
How Has This Been Tested?
test with running the fastapi locally with the updated code
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.