-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Adding exception details appears to mess up the report on Sentry #235
Comments
Interesting. Can you try with
I haven’t played around with that case specifically, I can try it later, though I’m tied up with something else right now. |
Yes, we do that already as well (after adding the exception data). Sorry I didn't note that initially. |
Still seeing this issue on 0.3.0 + sentry.io. Weirdly - if you go into the JSON for the event, you can see that source mapping worked, but it's not visible on the page in FULL mode. |
@mcdurdin Were attempting to do the same thing, it looks like you have to have the stack trace as part of the exception object for it to show up.
were doing this via sentry_event_value_add_stacktrace like so:
|
Yes, from an event payloads perspective, the stack trace can either be in threads or on the exception, but I think in this case you would rather want to have it on the exception. The API is a bit misleading here. |
I should have read the issues on this repo more closely as I ran into this same thing but ended up just adding a function to add a stacktrace to a value (in my case, the exception object) before adding that value to the event itself, so in Rust it looks something like let exc = sentry_native::Map::new();
exc.insert("type", "panic");
exc.insert("value", msg);
exc.add_stacktrace(0);
let eve = Event::new();
eve.insert("level", "fatal");
eve.insert("exception", exc);
eve.capture(); void
sentry_value_add_stacktrace(sentry_value_t val, size_t len) {
void *walked_backtrace[256];
len = sentry_unwind_stack(NULL, walked_backtrace, 256);
sentry_value_t frames = sentry__value_new_list_with_size(len);
for (size_t i = 0; i < len; i++) {
sentry_value_t frame = sentry_value_new_object();
sentry_value_set_by_key(frame, "instruction_addr",
sentry__value_new_addr((uint64_t)walked_backtrace[len - i - 1]));
sentry_value_append(frames, frame);
}
sentry_value_t stacktrace = sentry_value_new_object();
sentry_value_set_by_key(stacktrace, "frames", frames);
sentry_value_set_by_key(val, "stacktrace", stacktrace);
} |
@Jake-Shadle just commented on your rust PR. I think the best thing to do here would be to deprecate
I think the naming here is quite clear. While yes, |
Yah, that sounds like it would be fine, trust me, totally aware this was a total hack. ;) |
@Swatinem An issue I see with I have code im using in our sentry integration (haven't made into a PR yet) that adds a |
That is true. I will discuss this internally to see what would make the most sense here.
Great idea! |
I'm not clear if this should be added here or in another location. Please move the issue as necessary.
We're manually reporting exceptions in our app by adding in the
exception
value when sending an event, as described at https://docs.sentry.io/platforms/native/#exceptions:As soon as we do this, the report on Sentry ends up formatted wrongly, losing visibility of the call stack:
Using sentry-native 0.2.3. This issue arises both on sentry.io and our on premise sentry instance.
Originally raised at https://forum.sentry.io/t/corrupted-display-when-exception-data-is-set-using-native-sdk/9167/3
The text was updated successfully, but these errors were encountered: