Repository navigation
feat(spanv2): Add db attribute normalization - #5399
Merged
Ahmed-Labs merged 17 commits intoNov 25, 2025
Merged
Ahmed-Labs merged 17 commits into
Ahmed-Labs merged 17 commits into
Conversation
Ahmed-Labs
force-pushed
the
ahmed/feat/use-sentry-conventions-for-span-field-scrubbing
branch
from
November 21, 2025 20:01
1650016 to
ee9d220
Compare
Ahmed-Labs
marked this pull request as ready for review
November 24, 2025 14:24
Dav1dde
reviewed
Nov 24, 2025
Ahmed-Labs
force-pushed
the
ahmed/feat/use-sentry-conventions-for-span-field-scrubbing
branch
from
November 24, 2025 17:52
4189733 to
db55137
Compare
mjq
reviewed
Nov 24, 2025
Ahmed-Labs
force-pushed
the
ahmed/feat/use-sentry-conventions-for-span-field-scrubbing
branch
2 times, most recently
from
November 24, 2025 20:39
9716023 to
7051a5c
Compare
Contributor
Author
|
@Dav1dde Thanks for the review! 🙏 Addressed all your comments, let me know if there's anything else I should update. |
Dav1dde
approved these changes
Nov 25, 2025
Dav1dde
left a comment
Member
There was a problem hiding this comment.
Thanks for the contribution, looks good!
It'd be great if you can add or modify an existing integration test in test_spansv2.py or test_spansv2_otel.py` to also send some database attributes to just assert that normalization actually happens and is called.
It should be enough if you just add some attributes to a basic test.
Ahmed-Labs
force-pushed
the
ahmed/feat/use-sentry-conventions-for-span-field-scrubbing
branch
from
November 25, 2025 16:46
ec5c538 to
6f1f0c0
Compare
…helper function to accept attributes instead of spans
…tion crate and add function documentation
Ahmed-Labs
force-pushed
the
ahmed/feat/use-sentry-conventions-for-span-field-scrubbing
branch
from
November 25, 2025 20:56
fb8818f to
19135aa
Compare
Ahmed-Labs
enabled auto-merge
November 25, 2025 20:56
Ahmed-Labs
disabled auto-merge
November 25, 2025 21:13
Ahmed-Labs
deleted the
ahmed/feat/use-sentry-conventions-for-span-field-scrubbing
branch
November 25, 2025 21:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In V1 spans, normalization of any type of span happens in the description field. So in the case of db spans, relay expects the db query to be stored in the description field, which it reads, normalizes, and writes to a normalized description field.
This PR begins to migrate this normalization logic to V2 spans. But in the case of V2 spans, we expect the SDKs/Otel to send attributes in their corresponding fields as opposed to just using the description field. For instance, this means that we no longer expect a db query to be stored in description, and instead it should be in the
db.query.textfield. To start migrating normalization, this PR tackles the normalization of db related attributes.The actual logic for normalization is extracted from the SpanV1 tag extraction function and the description scrubbing function.
Note: This branch is stacked on top of another PR that bumps the version of sentry-conventions, introducing one of the fields I use here to store the normalized db query
sentry.normalized_db_query. So you can ignore that the sentry convention bump is included here, this branch will be rebased once that PR is merged.