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
refactor(instrumentation-xhr): use exported strings for semantic attr… #4681
base: main
Are you sure you want to change the base?
Conversation
…ibutes Signed-off-by: Prashansa Kulshrestha <prashkulshrestha@gmail.com>
Signed-off-by: Prashansa Kulshrestha <prashkulshrestha@gmail.com>
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.
Overall looks good, just one nit.
); | ||
assert.strictEqual( | ||
attributes[keys[1]], | ||
url, | ||
`attributes ${SemanticAttributes.HTTP_URL} is wrong` | ||
`attributes ${SEMATTRS_HTTP_URL} is wrong` | ||
); | ||
assert.ok( |
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.
Looks like there was a typo on L368 where it should have been replaced but I did not as it's not a template string. (and there's a typo). Would you mind replacing that one too (and change it to a template string)? 🙂
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.
Hey @pichlermarc,
On L368 in main, SemanticAttributes.HTTP_RESPONSE_CONTENT_SIZE
is used. There's no equivalent exported string called SEMATTRS_HTTP_RESPONSE_CONTENT_SIZE.
Can we use SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH instead?
As per the exported SemanticAttributes file here, it is defined as: The size of the response payload body in bytes.
Tried it with SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH
. It doesn't break any tests. Should be okay I suppose?
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.
Added the above replacement. Let me know if it's fine.
…SE_CONTENT_SIZE to new exported string Signed-off-by: Prashansa Kulshrestha <prashkulshrestha@gmail.com>
Which problem is this PR solving?
Updates #4567
Short description of the changes
Replace SemanticAttributes.* with specific exported strings for xml-http-request instrumentation package.
Type of change
Please delete options that are not relevant.
Refactoring change which removes the use of deprecated SemanticAttributes.*
How Has This Been Tested?
Checklist: