Skip to content
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

fix: fastapi auto-instrumentation by removing fastapi-slim support #2783

Conversation

smoke
Copy link
Contributor

@smoke smoke commented Aug 7, 2024

Description

fastapi-slim support was introduced via #2683 as a response to fastapi maintainers adding a no-dependencies package called fastapi-slim.

The changes over opentelemetry-instrumentation-fastapi have broken auto-instrumentation via opentelemetry-instrument as reproduced here https://github.com/smoke/fastapi-autoinstrumentation-fails
causing Skipping instrumentation fastapi: DependencyConflict: requested: "fastapi-slim~=0.111.0" but found: "None" (when used with OTEL_PYTHON_LOG_LEVEL=debug as #1745 is not yet available)

The fastapi-slim itself is discontinued from maintainers as it caused issues with users of it.
Given it causes issues with opentelemetry auto-instrumentation as well, it is removed as most feasible option.

see fastapi/fastapi#11522 (comment)
see https://fastapi.tiangolo.com/release-notes/#01120

Fixes #2683 (comment)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@smoke smoke requested a review from a team August 7, 2024 07:13
@smoke smoke mentioned this pull request Aug 7, 2024
@smoke smoke force-pushed the fix/fastapi-auto-instrumentation-remove-fastapi-slim-support branch 2 times, most recently from 162363f to 6389d14 Compare August 7, 2024 07:26
@smoke smoke force-pushed the fix/fastapi-auto-instrumentation-remove-fastapi-slim-support branch from 6389d14 to 6e7f204 Compare August 7, 2024 07:50
@smoke
Copy link
Contributor Author

smoke commented Aug 7, 2024

Checks fail because of side flacky test instrumentation-flask-0 pypy-3.8 Ubuntu https://github.com/open-telemetry/opentelemetry-python-contrib/actions/runs/10280305618/job/28447490916

tox.ini Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
smoke and others added 2 commits August 7, 2024 17:22
Co-authored-by: Emídio Neto <[email protected]>
Co-authored-by: Emídio Neto <[email protected]>
Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this fix, including issue comments and how to reproduce. The pyproject.toml and helper function changes also fixed my own local setup.

Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested pointing one of my workloads to this branch and it's working again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fastapi-slim support
4 participants