-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Reverse stack traces #87
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
Conversation
We were sending stack traces in the wrong order. Using unshift instead of push makes sure we sent them in the correct order. Fixes getsentry#86
You can change how it's displayed in Sentry. The way that Raven ships it is correct. https://app.getsentry.com/account/settings/appearance/ And if Sentry is displaying it incorrect by default, it's a thing for Sentry. |
No it's not, look at the screenshot in #86. It says "most recent call first" but shows the last call first. It's nothing to do with the appearance setting. Either Raven-JS is sending it in the wrong order, or the string in Sentry is incorrect and should be reversed. |
I put some console.logs in right where you change the push to unshift, and the stack traces raven creates appear correct with push. at least as far as the array is concerned. Are we sure that sentry does not want the stack trace sent in reverse order though? The sentry docs are rather unhelpful, especially where the protocol is concerned. |
I'm pretty sure I'm doing this backwards based on how it's expected to be received in Sentry. I think this should and can very easily be handled properly on Sentry automatically. Each language has a different "natural" order, and that natural order can and should be preserved. So as of now, since it's literally just a slightly confusing use of language, I'm going to keep this closed, and propose a solution for Sentry instead. |
You really shouldn't go that route. You may not like it, but the current API is just "stacktraces are backwards from JS". You can't just change that in Sentry, you'll break clients that currently do the right thing. It'll be impossible for clients to always do the right thing, since they can't just guess the version of Sentry and then send stack traces accordingly. You're basically introducing a new major API version that is incompatible with older versions. Sure, you could add another parameter to sentry If you're really concerned about performance of Also, the language thing might be more confusing than you think. The order preference is per account, so if you have both a Python and a JS project in your account, one of them will show incorrect and the other will show correct, whatever option you choose. It's not just a misleading string, it's really wrong data we're sending here. |
I'm with @pieter on not feeling |
Yeah, I'm definitely not against it because of @pieter, the current language stuff in Sentry is a hack. It was a hack to hold over until we have proper language support. Sentry already knows which language each event is, so it'd be easy to apply certain rules per language. I already have a patch waiting that will start rendering them with language specific stack traces so everything doesn't look like Python. The next step is just handling the stack order per language. The point being, it's not something that I want to solve just for raven-js. It should be solved for all languages, and it'd be very simple to do in Sentry itself. The concept of determining what language an event is has already been done. By doing this, I'm really not worried about breaking Sentry or needing to force someone to upgrade. Really, this is the first that it has ever been brought up from any users, including myself, and nobody has noticed that it was wrong in the first place. :) The data is there, it's just backwards. So I'd hardly say that people should be required to upgrade. |
Capture stack traces when captureError() is called without an Error object
We were sending stack traces in the wrong order. Using
unshift instead of push makes sure we sent them in the
correct order.
Fixes #86