Fix asyncpg spans by sentrivana · Pull Request #3639 · getsentry/sentry-python · GitHub
Skip to content

Fix asyncpg spans - #3639

Merged
sl0thentr0py merged 13 commits into
potel-basefrom
ivana/potel/fix-asyncpg
Oct 15, 2024
Merged

sl0thentr0py merged 13 commits into
potel-basefrom
ivana/potel/fix-asyncpg

Conversation

@sentrivana

@sentrivana sentrivana commented Oct 10, 2024

Copy link
Copy Markdown
Contributor
  • Change span.set_data to span.set_attribute

  • Change start_transactions in the tests to start_spans

  • Stringify db.params, db.paramstyle, db.cursor

  • ❗ Change how adding query source works.
    Previously, we first let the DB span finish and then looked at its start and end timestamps to figure out if the query was slow enough to attach query data.

    With the switch to OTel, we can no longer put stuff on a finished span, meaning the slow query span still has to be alive when adding data to it. So instead of looking at the end timestamp of a finished span, we keep the span alive and instead look at current time at the point when the query is finished.

    This means the DB span will be longer than the actual query (since it now includes adding query data).

@codecov

codecov Bot commented Oct 10, 2024

Copy link
Copy Markdown

Comment on lines +82 to +83

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the query source change from the PR description

@sentrivana
sentrivana marked this pull request as ready for review October 11, 2024 09:09
@sl0thentr0py
sl0thentr0py merged commit ef7c39c into potel-base Oct 15, 2024
@sl0thentr0py
sl0thentr0py deleted the ivana/potel/fix-asyncpg branch October 15, 2024 14:45
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.

2 participants