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 tracing of async cursors for psycopg #3324

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ibash
Copy link

@ibash ibash commented Mar 4, 2025

Description

This copies the traced_execution of AsyncCursorTracer except query_method is awaited within the span.

Fixes #2486

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?

I ran this locally by making the corresponding changes in my site-packages folder. Then I checked logfire (what we're using for opentelemetry) to confirm that sql queries now had non-zero timings.

Also ran the tox command to run tests.

Happy to build and test the built package if you tell me how to build!

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

Copy link

linux-foundation-easycla bot commented Mar 4, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: ibash / name: Islam Sharabash (ecea87a)

This copies the traced_execution of AsyncCursorTracer except
query_method is awaited within the span.

Fixes open-telemetry#2486
@ibash ibash force-pushed the ibash/async_tracing branch from dbd1d23 to ecea87a Compare March 5, 2025 16:39
@ibash
Copy link
Author

ibash commented Mar 5, 2025

@federicobond would love a review when you get a chance!

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.

opentelemetry-instrumentation-psycopg claims to work for async queries, but doesn't record time
2 participants