Repository navigation
ref(attributes): Use JSON for aws.s3.delete & document multi-collection db.collection.name
#711
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
83b55cb
ref(attributes): Use JSON for `aws.s3.delete`, document multi-collect…
pabloDeputter 06ef18a
fix(attributes): Fix `brief` fpr `aws.s3.delete`
pabloDeputter cf86f6a
Merge branch 'main' into pablo/aws-s3-delete-db-collection-name
pabloDeputter bb2facd
Merge branch 'main' into pablo/aws-s3-delete-db-collection-name
pabloDeputter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at documentation in OTel how they treat multiple collections but it doesn't seem like they specify anything regarding multiple collections. Looking at their database span spec, it seems like they only want this attribute to be set, when the db operation is done on one collection.
I think this is free to interpretation but I would assume that when you have something like
SELECT * FROM users JOIN orders ON ...,db.collection.nameshould only holdusers.This is a string attribute, so I'd prefer we avoid joining multiple values into one string.
Are we doing the comma-joined list already somewhere? If so, why the leading
,? 😅There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I noticed that as well. So for a
JOINOTel will probably omit bothusersandorders. Howeverdb.collection.nameis already set to this joined form by Relay; I sent a few queries through the python-SQLAlchemy integration (which never setsdb.collection.name): https://sentry-sdks.sentry.io/explore/traces/trace/a4c29d7664f047bfac9ba507460c7ed1/?mode=samples&node=span-a7290e2aed0619ab&project=4511733153660928&source=traces&statsPeriod=1h&table=trace×tamp=1791970030.188SELECT * FROM users JOIN orders ON ...=>,orders,users,SELECT * FROM "acme-shop-customers" …; SELECT * FROM "acme-shop-orders" …=>,acme-shop-customers,acme-shop-orders,SELECT * FROM "Users" WHERE ...=>,users,So pretty sure Relay sets
db.collection.name(when not provided by the SDK) based offquery.text; sorts and lower-cases it as well.So that's why I added the new example to it, I probably should have been a bit more specific on why I changed this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sql_tables_from_query()implements this extraction, sorting and lower-casing: https://github.com/getsentry/relay/blob/4e69c4221c841ec7f0c6e43b252bffeb1b3e7dde/relay-event-normalization/src/normalize/span/tag_extraction.rs#L1396-L1431There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I looked at this again and OTel ([1] remark at https://opentelemetry.io/docs/specs/semconv/registry/attributes/db/#db-collection-name) states that it should not be extracted from
db.query.textwhen the db system supports queries over multiple collections (which basically covers any SQL db), and recommends no case normalization.sql_tables_from_query()does both of these things whendb.collection.nameisn't set by the SDK (Users=>,users,,users JOIN orders=>,orders,users,).The commas are inherited from v1
span.domainwhich was (I think) so a contains-search can differentiate,users,from,users_postfix,(getsentry/relay#5399)