getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.39k stars 4.11k forks source link

Support JSON Beautification for Error messages #71639

Open smeubank opened 3 months ago

smeubank commented 3 months ago

Problem Statement

When there is an error message which comes from API and it can respond with a proper JSON, or other scenario Sentry doesn't display it in a proper formatted JSON manner. Which is not that nice on the eyes.

Twitter thread with backgorund https://x.com/bnayagrawal/status/1795083809852965319

Solution Brainstorm

Make it nice on the eyes, at least in golden path scenario, or in an expandable way. Meaning we should not format and take up too much of the screen but it would be nice to have the option for user to be able to quickly parse the JSON and potentially identify any problematic key value pairs

Product Area

Issues

smeubank commented 3 months ago

In the meantime, try using https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/extraerrordata/ - this will extract all the top level keys from the thrown error and add them as context to the error event, which makes them display nicely.