Skip to content

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

k-fish
Copy link
Member

@k-fish k-fish commented Aug 8, 2025

Summary

This adds some actions below the details when opening a log in the logs table.

This adds some actions below the details when opening a log in the logs
table.
@k-fish k-fish requested a review from a team August 8, 2025 23:28
@k-fish k-fish requested a review from a team as a code owner August 8, 2025 23:28
Copy link

linear bot commented Aug 8, 2025

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 8, 2025
cursor[bot]

This comment was marked as outdated.

}
}
}
return JSON.stringify(copy, null, 2);
Copy link
Member

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.

cursor[bot]

This comment was marked as outdated.

@k-fish k-fish force-pushed the feat/ourlogs/add-copy-as-json/logs-135 branch from 8ac8d43 to 57328fe Compare August 11, 2025 18:15
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Aug 12, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
11410 1 11409 10
View the top 1 failed test(s) by shortest run time
logsTableRow copies log as JSON when Copy as JSON button is clicked
Stack Traces | 0.434s run time
Error: expect(received).toBeDefined()

Received: undefined
    at Object.toBeDefined (.../logs/tables/logsTableRow.spec.tsx:453:58)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.


successMessage: t('Copied!'),
errorMessage: t('Failed to copy'),
});
Copy link
Contributor

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.

Fix in Cursor Fix in Web

delete copy[key];
copy[key.replace('tags[sentry.', 'tags[')] = value;
}
}
Copy link
Contributor

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants