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

Support AsyncEngine to SQLAlchemy #717

Merged
merged 2 commits into from
Dec 23, 2024
Merged

Support AsyncEngine to SQLAlchemy #717

merged 2 commits into from
Dec 23, 2024

Conversation

Kludex
Copy link
Member

@Kludex Kludex commented Dec 23, 2024

Copy link

cloudflare-workers-and-pages bot commented Dec 23, 2024

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5b02c4b
Status: ✅  Deploy successful!
Preview URL: https://2ca203b1.logfire-docs.pages.dev
Branch Preview URL: https://support-async-engine.logfire-docs.pages.dev

View logs

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (cb9ad81) to head (5b02c4b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #717   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          137       137           
  Lines        11031     11059   +28     
  Branches      1539      1546    +7     
=========================================
+ Hits         11031     11059   +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@alexmojaki alexmojaki left a comment

Choose a reason for hiding this comment

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

Great, thanks!

Comment on lines +383 to +384

SQLAlchemyInstrumentor().uninstrument()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
SQLAlchemyInstrumentor().uninstrument()

Copy link
Member Author

Choose a reason for hiding this comment

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

We can't, bug in OTel regarding uninstrumentation/instrumentation.

@pytest.mark.anyio
async def test_sqlalchemy_async_instrumentation(exporter: TestExporter):
with sqlite_async_engine(Path('example.db')) as engine:
logfire.instrument_sqlalchemy(engine=engine)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logfire.instrument_sqlalchemy(engine=engine)
logfire.instrument_sqlalchemy(engine)

@Kludex Kludex enabled auto-merge (squash) December 23, 2024 10:00
@Kludex Kludex merged commit 0d21837 into main Dec 23, 2024
13 checks passed
@Kludex Kludex deleted the support-async-engine branch December 23, 2024 10:03
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.

async sqlalchemy engine support
2 participants