rollbar / rollbar.js

Error tracking and logging from Javascript to Rollbar
https://docs.rollbar.com/docs/javascript
MIT License
566 stars 212 forks source link

feat: Support `URL` object in `fetch` / `XHR` telemetry #1118

Closed dj-stormtrooper closed 11 months ago

dj-stormtrooper commented 11 months ago

Description of the change

Please include a summary of the change and which issues are fixed. Please also include relevant motivation and context.

At Fingerprint.js we have experienced several issues with our customers who use Rollbar. Some telemetry events weren't captured due to unsupported URL type in fetch / XHR (see Parameter section - the URL type is valid argument type for fetch).

I added support to rollbarInstrumenter and covered this behaviour with unit tests.

fetch and XHR support any object with stringifier, so I can extend this condition to any object with toString method, thought it might be not really useful. Feel free to discuss the solution

Type of change

Related issues

Shortcut stories and GitHub issues (delete irrelevant)

I didn't create particular issue for Rollbar, but It's similar to what had with Honeybadger: issue, PR

Checklists

Development

Code review

dj-stormtrooper commented 11 months ago

That would be fine (but not necessary) as long as comments make it obvious that it's primarily meant to support URL.

Yeah, I think we can keep it more specific, there is no need for a flexible solution here

I can accept this as is.

Great, thanks!

goibon commented 5 months ago

@waltjones any chance we can get a new version of this package released that includes this change? I've been debugging why my project didn't have any paths in the network telemetry events and this PR looks like it would fix it. We use fetch with URL objects as the first parameter.

waltjones commented 5 months ago

@goibon Released: https://github.com/rollbar/rollbar.js/releases/tag/v2.26.3

Apologies for the delay.