feat(logs): Add JSON pretty-printing for log attributes#111077
feat(logs): Add JSON pretty-printing for log attributes#111077JoshuaKGoldberg merged 4 commits intomasterfrom
Conversation
2dd46b3 to
943f493
Compare
943f493 to
1163792
Compare
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
9fcb38d to
1ffb7f8
Compare
1e83e93 to
8c8b184
Compare
8c8b184 to
8db213f
Compare
| * Attempts to parse a JSON string, recursively unwrapping double-stringified arrays. | ||
| */ | ||
| export function tryParseJson(value: unknown): unknown { | ||
| export function tryParseJsonRecursive(value: unknown): unknown { |
There was a problem hiding this comment.
See #111077 (comment): renaming this to disambiguate. Both in general and from the tryParseJson I added to attributesTreeValue.tsx.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Compact mode hides collapsed content indicators in nested JSON
- Changed CSS selector from 'button' to 'button[aria-label]' to only hide toggle buttons while preserving NumItemsButton that shows collapsed content indicators.
Or push these changes by commenting:
@cursor push 7bca11c525
Preview (7bca11c525)
diff --git a/static/app/views/explore/components/traceItemAttributes/attributesTreeValue.tsx b/static/app/views/explore/components/traceItemAttributes/attributesTreeValue.tsx
--- a/static/app/views/explore/components/traceItemAttributes/attributesTreeValue.tsx
+++ b/static/app/views/explore/components/traceItemAttributes/attributesTreeValue.tsx
@@ -129,7 +129,7 @@
padding-left: 0;
}
- button {
+ button[aria-label] {
display: none;
}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.


Add pretty-printing for JSON attribute values in the logs attributes tree.
String attribute values that contain valid JSON (
{or[that passJSON.parse) are now rendered usingStructuredEventDatainstead of plain text, providing a collapsible, syntax-highlighted tree view.Simple JSON where all values are primitives (e.g.
{"boop": "bop"}) renders compactly inline via CSS overrides, while nested structures get the full expandable tree with toggle buttons. The styled wrapper also resets<pre>default margins to keep the tree row grid layout properly aligned.Fixes LOGS-400
Made with Cursor