You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Tom Moor, adam, Idris Mokhtarzada, Koong Kyungmi, Matthew Vandenbossche, Billy Vong, alekzonder, François KLINGLER, Duncan Lukkenaer, Andreas Heissenberger and 14 more
In browser JavaScript, we fetch the sources remotely, or they are uploaded as a part of a release. For raven-node, we don't do any of these steps since we can read the source code from disk. So we get lines of source, and it'd be impossible to discover the source the //sourceMappingUrl from the server. So either: a) discover this by the client, and send this over as a new attribute, or b) require uploading minified code as a part of releases, which we currently don't do for anything except browser js today.
Apply source maps
In similar vain to discovery, how do we apply these? Would we require a user to upload all minified and unminifed code to us and basically treat it like browser js? If so, would the client opt out of sending any lines of context? We'd need some way to signal to the server, "hey, you should look for sources that were uploaded". These flows are going to need to be a bit different for node, since we can't fetch via HTTP and files are no longer going to be urls, they'll be file system paths.
OR, we could apply the sourcemap in raven-node, but my hunch is that in the scenarios that people are using minified code in node, the sourcemap and original source is unavailable, so this probably won't be as compatible.
I think raven-node should apply the sourcemap. My docker build has the full source in it, and wouldn't mind giving raven-node the directory of the build (with the compiled .js and .map files), as well as the directory with the source files.
The one weird thing about my build is I have multiple build folders, so accepting an array of folders would be nice.
Can you confirm that this still isn't supported? I just spent half a day trying to figure out why sourcemaps uploaded as release artifacts aren't applied to errors - could it be because I'm using the raven-node client?
Ouch, to say this is frustrating would be an understatement - would you be able to put a big fat warning on the node integration docs until this is implemented?
Reacted by Adam Biggs, terry heath and Leo Kyrpychenko
It might be obvious to your team, less so to an outsider - node is just javascript after all.
I just assumed it would work as the processing is happening on sentry's servers - you have the map artifacts, the original source files and the sourceMapUrl - it's not clear why the client the error is sent from matters.
Reacted by Adam Biggs, Michael Robinson, Keivan Beigi and heleg
@tommor to be fair everything in the JavaScript docs points at the browser and we have entirely separate docs for Node.
There's a lot of reasons why we only do this for browser right now. We wouldn't blindly allow lookup of source maps which don't have URLs so without uploading them the concept wouldn't even work. This is extremely different to how sourcemaps we're originally built and generally used.
It's something we'll likely add in the future but we are very careful about how we support things.
"hey, you should look for sources that were uploaded"
Is this something that needs to be supported server side in addition to some lib changes? I would be happy to extend raven-node, but it seems like there is some server side (Sentry) support for this to work. I compared different payloads between browser (raven-js) and node (raven-node), the payload is equivalent, in both cases the sourcemaps are published to sentry, the main difference in the payload is the sentry_client used and the sentry_version.
Is the spec defined? Meaning, if I publish a release from node and use a path for it, what do I need to push to api/{id}/store/ in order for this to work?
My scenario is a bit different, but somewhat related. We're have a logger-service written in node that logs information from the broswer like a/b testing, analytics, errors. All the error information goes to sentry, sumologs and our analytics platform. So we don't really have sourcemap information client side and raven-node doesn't have an easy way to get them in order to map the frames. We would rather have this done server side.
The following is an example stack trace logged by raven-node, proxying a browser error:
The only "significant" differences around the stack traces is that raven-node adds a modulename but raven-js doesn't have it. Other likely relevant differences are the logger (javascript, "") and platform ("javascript", "node").
As an aside, IMO, doing this server side is also a better approach than getting raven-node doing this. While sourcemaps may be available in some cases on the server with the minified code, processing this sourcemaps seems like a different concern, this could easily add IO and memory concerns that the server doesn't have, for large applications I don't think it's a good idea to do the mapping and that's something that would be better to do on a server that is already optimized for this. Also, sentry already does this for browser errors, so it may be better not to have to duplicate this logic there.
Activity
mattrobenolt commentedon Jun 2, 2016
Itemizing issues for discussion:
Source map discovery
In browser JavaScript, we fetch the sources remotely, or they are uploaded as a part of a release. For
raven-node, we don't do any of these steps since we can read the source code from disk. So we get lines of source, and it'd be impossible to discover the source the//sourceMappingUrlfrom the server. So either: a) discover this by the client, and send this over as a new attribute, or b) require uploading minified code as a part of releases, which we currently don't do for anything except browser js today.Apply source maps
In similar vain to discovery, how do we apply these? Would we require a user to upload all minified and unminifed code to us and basically treat it like browser js? If so, would the client opt out of sending any lines of context? We'd need some way to signal to the server, "hey, you should look for sources that were uploaded". These flows are going to need to be a bit different for node, since we can't fetch via HTTP and files are no longer going to be urls, they'll be file system paths.
OR, we could apply the sourcemap in raven-node, but my hunch is that in the scenarios that people are using minified code in node, the sourcemap and original source is unavailable, so this probably won't be as compatible.
/cc @benvinegar
tuckerconnelly commentedon Oct 14, 2016
I think raven-node should apply the sourcemap. My docker build has the full source in it, and wouldn't mind giving raven-node the directory of the build (with the compiled
.jsand.mapfiles), as well as the directory with the source files.The one weird thing about my build is I have multiple build folders, so accepting an array of folders would be nice.
tommoor commentedon Nov 11, 2016
Can you confirm that this still isn't supported? I just spent half a day trying to figure out why sourcemaps uploaded as release artifacts aren't applied to errors - could it be because I'm using the raven-node client?
mattrobenolt commentedon Nov 11, 2016
This definitely is not yet supported.
tommoor commentedon Nov 11, 2016
Ouch, to say this is frustrating would be an understatement - would you be able to put a big fat warning on the node integration docs until this is implemented?
mattrobenolt commentedon Nov 11, 2016
To be fair, nothing in the documentation suggests that they do work. All of our sourcemap documentation is under the raven-js docs.
tommoor commentedon Nov 11, 2016
It might be obvious to your team, less so to an outsider - node is just javascript after all.
I just assumed it would work as the processing is happening on sentry's servers - you have the map artifacts, the original source files and the sourceMapUrl - it's not clear why the client the error is sent from matters.
dcramer commentedon Nov 12, 2016
@tommor to be fair everything in the JavaScript docs points at the browser and we have entirely separate docs for Node.
There's a lot of reasons why we only do this for browser right now. We wouldn't blindly allow lookup of source maps which don't have URLs so without uploading them the concept wouldn't even work. This is extremely different to how sourcemaps we're originally built and generally used.
It's something we'll likely add in the future but we are very careful about how we support things.
bfritscher commentedon Nov 24, 2016
Hi I am using https://github.com/evanw/node-source-map-support . That way I get a partial sourcemap stacktrace inside sentry.
MiguelMadero commentedon Dec 3, 2016
Is this something that needs to be supported server side in addition to some lib changes? I would be happy to extend raven-node, but it seems like there is some server side (Sentry) support for this to work. I compared different payloads between browser (raven-js) and node (raven-node), the payload is equivalent, in both cases the sourcemaps are published to sentry, the main difference in the payload is the
sentry_clientused and thesentry_version.Is the spec defined? Meaning, if I publish a release from node and use a path for it, what do I need to push to
api/{id}/store/in order for this to work?MiguelMadero commentedon Dec 5, 2016
My scenario is a bit different, but somewhat related. We're have a logger-service written in node that logs information from the broswer like a/b testing, analytics, errors. All the error information goes to sentry, sumologs and our analytics platform. So we don't really have sourcemap information client side and raven-node doesn't have an easy way to get them in order to map the frames. We would rather have this done server side.
The following is an example stack trace logged by raven-node, proxying a browser error:
The following is an example stack trace logged by raven-js of the same error:
The only "significant" differences around the stack traces is that raven-node adds a
modulenamebut raven-js doesn't have it. Other likely relevant differences are thelogger(javascript, "") and platform ("javascript", "node").As an aside, IMO, doing this server side is also a better approach than getting raven-node doing this. While sourcemaps may be available in some cases on the server with the minified code, processing this sourcemaps seems like a different concern, this could easily add IO and memory concerns that the server doesn't have, for large applications I don't think it's a good idea to do the mapping and that's something that would be better to do on a server that is already optimized for this. Also, sentry already does this for browser errors, so it may be better not to have to duplicate this logic there.
curioussavage commentedon Jan 20, 2017
@mattrobenolt it would be awesome if the node docs explicitly stated that source maps are not supported.
25 remaining items
iEchoic commentedon Oct 10, 2017
@bilby91 sure: http://jlongster.com/Backend-Apps-with-Webpack--Part-I
I'm doing it to share the same build pipeline with my frontend, and to use some useful Webpack plugins (like circular-dependency-plugin).
sbuljac commentedon Oct 11, 2017
+1
tybro0103 commentedon Oct 27, 2017
+1
kamerat commentedon Nov 9, 2017
+1
leonkyr commentedon Jan 3, 2018
+100
mitsuhiko commentedon Jan 3, 2018
@kamilogorek can we close this issue now?
netproteus commentedon Jan 3, 2018
If this is resolved by #6626 can we have some docs before this is closed, please.
tybro0103 commentedon Jan 3, 2018
@kamilogorek @mitsuhiko Ooh, nice! Whenever this is available to use, would you mind notifying us here?
kamilogorek commentedon Jan 9, 2018
@netproteus docs are already in place :) https://docs.sentry.io/clients/node/sourcemaps/#raven-node-sourcemaps
cc @tybro0103
@mitsuhiko yes, go ahead
sheerun commentedon Sep 30, 2018
@kamilogorek Is there similar solution from
@sentry/node?kamilogorek commentedon Oct 1, 2018
@sheerun it works exactly in the same way in the new SDK (just use
beforeSendinstead ofdataCallback).https://docs.sentry.io/platforms/javascript/sourcemaps/
https://docs.sentry.io/clients/node/sourcemaps/
sheerun commentedon Oct 2, 2018
It turns out not exactly because different object is provided to beforeSend (not exception). Here's the code I use:
@kamilogorek Do you think SDK could do it automatically (maybe as a flag), instead documenting this hack again?
kamilogorek commentedon Oct 3, 2018
@sheerun WIP: getsentry/sentry-javascript#1611