-
Notifications
You must be signed in to change notification settings - Fork 795
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
feat(instrumentation-xhr): add applyCustomAttributesOnSpan hook #2134
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2134 +/- ##
==========================================
+ Coverage 92.76% 92.79% +0.03%
==========================================
Files 140 140
Lines 4987 4998 +11
Branches 1029 1032 +3
==========================================
+ Hits 4626 4638 +12
+ Misses 361 360 -1
|
packages/opentelemetry-instrumentation-xml-http-request/src/xhr.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-xml-http-request/src/xhr.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Daniel Dyla <[email protected]>
Co-authored-by: Daniel Dyla <[email protected]>
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.
lgtm, the additional level with describe looks nice on html report when they are joined with some AND / OR dependency - this is just suggestion not a blocker. Thx for more tests :)
packages/opentelemetry-instrumentation-xml-http-request/test/xhr.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-xml-http-request/test/xhr.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-xml-http-request/test/xhr.test.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-xml-http-request/test/xhr.test.ts
Outdated
Show resolved
Hide resolved
…hr.test.ts Co-authored-by: Bartlomiej Obecny <[email protected]>
…hr.test.ts Co-authored-by: Bartlomiej Obecny <[email protected]>
…hr.test.ts Co-authored-by: Bartlomiej Obecny <[email protected]>
…hr.test.ts Co-authored-by: Bartlomiej Obecny <[email protected]>
I want to add the request body to span attributes, but the xhr reference can not seem to get the request body. Is there a good solution for it? :) |
We've had couple of asks to add custom attributes to already autoinstrumented XHR. It seems fetch already has this functionality #2071. There is a little annoyance that I can't make the hook function parameters the same as there is no separate Request and Response available in XHR. So the hook has span and xhr reference.
Added tests for different fail types(maybe overkill).