fix(db): Clarify db.query.text and db.query.summary attributes#208
fix(db): Clarify db.query.text and db.query.summary attributes#208
db.query.text and db.query.summary attributes#208Conversation
lcian
left a comment
There was a problem hiding this comment.
LGTM, you will need to regenerate and reformat.
Also, example needs to be a string, we can change that but for the purpose of the PR just provide a single example as a string.
|
+1 for being able to add more than one example. For now I removed the second example. Thanks for the review! |
|
@mjq and @Ahmed-Labs should take a look here as well. |
|
Makes sense! We will probably have to update db attribute normalization logic because we currently expect a raw query as opposed to a parametrized one in |
|
Just to add here, JS SDK instrumentations have been sending the parametrized version in |
|
@Ahmed-Labs @cleptric should we move forward with this change? |
| }, | ||
| "is_in_otel": true, | ||
| "example": "SELECT * FROM users", | ||
| "example": "SELECT * FROM users WHERE id = $1", |
There was a problem hiding this comment.
If I have this query:
INSERT INTO exec_test (id, name) VALUES (?, ?, ?, ?)Should it become as it is, or:
INSERT INTO exec_test (id, name) VALUES (?)There was a problem hiding this comment.
OTel gives an example for an IN claus which I guess is the closest thing to your case. So you MAY shorten it to one ? but it's not required. Unless anyone has different opinions, I'd recommend we go with the actual number of values (as it is, in your case).
|
@mjq need your input here. |
|
Yeah this is fine. We're already set up to use |
2e1a59e to
77c0e7f
Compare
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Other
Bug Fixes 🐛Attributes
Other
Internal Changes 🔧Attributes
Deps Dev
Repo
Other
Other
🤖 This preview updates automatically when you update the PR. |
db.query.text: We previously specified this attribute to contain a full/raw query without parameterization. OTel requires the paramterized query.db.query.summaryWe specified this attribute to contain the paramterized query. OTel specifies a shortened operation/table "grouping".This came up while reviewing getsentry/sentry-javascript#17961