-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Add logs table row buttons (filters, copy as json etc.) #97545
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
Changes from 1 commit
57328fe
254b151
45bf302
ef87a9e
76dd8f4
550569f
4d4897f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -445,3 +445,36 @@ export function getLogsUrlFromSavedQueryUrl({ | |
}, | ||
}); | ||
} | ||
|
||
export function ourlogToJson(ourlog: OurLogsResponseItem): string { | ||
const copy = {...ourlog}; | ||
let warned = false; | ||
const warnOnce = (key: string) => { | ||
if (!warned) { | ||
warned = true; | ||
warn( | ||
fmt`Found sentry. prefix in ${key} while copying [project_id: ${ourlog.project_id}, user_email: ${ourlog.user_email}]` | ||
); | ||
} | ||
}; | ||
// Trimming any sentry. prefixes | ||
for (const key in copy) { | ||
if (key.startsWith('sentry.')) { | ||
const value = copy[key]; | ||
if (value !== undefined) { | ||
warnOnce(key); | ||
delete copy[key]; | ||
copy[key.replace('sentry.', '')] = value; | ||
} | ||
} | ||
if (key.startsWith('tags[sentry.')) { | ||
const value = copy[key]; | ||
if (value !== undefined) { | ||
warnOnce(key); | ||
delete copy[key]; | ||
copy[key.replace('tags[sentry.', 'tags[')] = value; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Log Attribute Cleanup and PII Logging IssueThe |
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Data Overwrite and Iteration IssuesThe
|
||
return JSON.stringify(copy, null, 2); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would user expect we return formatted json here? I'd just return Also this can throw, but I guess we can just rely on the error sentry captures to report back. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: PII Leakage and Data Overwrite in JSON ConversionThe |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Table Rendering Issues and Button Crashes
The expanded log row (
DetailsWrapper
, a<tr>
) incorrectly renders two<td>
cells (LogDetailTableBodyCell
andLogDetailTableActionsCell
), each set to span all columns. This invalid table structure can cause unpredictable rendering and layout issues.Additionally, clicking the "View Trace" button crashes for logs without a
trace_id
becauseadjustLogTraceID
is called with anundefined
value, leading to aTypeError
when.replace()
is invoked. The button should be hidden/disabled or the call guarded.Finally, the
LogDetailTableActionsCell
is missingdisplay: "flex"
, preventing itsalignItems
,justifyContent
, andflexDirection
styles from applying, which can lead to incorrect button layout.