Skip to content
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

autoInstrument is broken with got library #1103

Closed
richardsimko opened this issue May 15, 2023 · 5 comments · Fixed by #1136
Closed

autoInstrument is broken with got library #1103

richardsimko opened this issue May 15, 2023 · 5 comments · Fixed by #1136
Assignees

Comments

@richardsimko
Copy link

richardsimko commented May 15, 2023

Repro repo: https://github.com/richardsimko/rollbar-got-issue

Using autoInstrument does not work at all with the very popular http request library got.

When running the referenced repo with ROLLBAR_ACCESS_TOKEN=<token> node test.js it produces the following error:

TypeError: callback.apply is not a function
    at ClientRequest.<anonymous> (/Users/richard/git/rollbar-got-issue/node_modules/rollbar/src/server/telemetry.js:119:23)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:525:35)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:693:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at TLSSocket.socketOnData (node:_http_client:535:22)
    at TLSSocket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)

I believe the issue is in urlHelpers since it's assigning cb = options without checking that options actually is a function. Removing the assignment of cb = options does solve the issue, however I don't know what implications that might have for other things so I don't want to submit a PR with that as the solution.

@richardsimko richardsimko changed the title autoInstrument network is broken with got library autoInstrument is broken with got library May 15, 2023
@waltjones waltjones self-assigned this May 16, 2023
@waltjones
Copy link
Contributor

@richardsimko Thanks for the detailed report and test case. We'll take a look asap.

@gerwinbrunner
Copy link

we are running into the very same issue with got

@metaskills
Copy link

Same issue here.

@neokoenig
Copy link

Any update on this?

@waltjones
Copy link
Contributor

Released in 2.26.4. https://github.com/rollbar/rollbar.js/releases/tag/v2.26.4. Thank you @jaridmargolin .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants