-
-
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
base: master
Are you sure you want to change the base?
Conversation
This adds some actions below the details when opening a log in the logs table.
} | ||
} | ||
} | ||
return JSON.stringify(copy, null, 2); |
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.
would user expect we return formatted json here? I'd just return JSON.stringify(copy)
.
Also this can throw, but I guess we can just rely on the error sentry captures to report back.
8ac8d43
to
57328fe
Compare
…py-as-json/logs-135
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
|
||
successMessage: t('Copied!'), | ||
errorMessage: t('Failed to copy'), | ||
}); |
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: Clipboard Hook Logs Unconditionally
The useCopyToClipboard
hook unconditionally calls ourlogToJson(data)
on initialization. When data
is undefined
during the pending log details fetch, ourlogToJson
logs a warning. This results in noisy production logs and unnecessary overhead every time a log row is expanded. The JSON payload should be computed lazily on click or only after data
is available.
delete copy[key]; | ||
copy[key.replace('tags[sentry.', 'tags[')] = value; | ||
} | ||
} |
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: Log Attribute Cleanup and PII Logging Issue
The ourlogToJson
function incorrectly handles log attributes when copying as JSON. It fails to remove deprecated fields (listed in DeprecatedLogDetailFields
), leaving them in the output with their original sentry.
prefixes, which contradicts the intended cleanup. Additionally, it logs PII (user_email
, project_id
) via Sentry.logger.warn
whenever a sentry.
-prefixed key is processed, leading to unnecessary exfiltration of sensitive customer data to product telemetry.
Summary
This adds some actions below the details when opening a log in the logs table.