Skip to content
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

fix(breadcrumbs): Make all auto-generated breadcrumbs follow spec #884

Merged
merged 1 commit into from Nov 3, 2020

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Oct 20, 2020

Right now, if a user calls sentry_sdk.add_breadcrumb() on a dictionary containing non-standard keys, those keys will be serialized and sent to Sentry, but Relay will drop them without registering a processing error. In other words, it fails silently.

This PR adds a warning if a user includes such a call in their code. The list of standard keys is taken from the SDK spec here.

UPDATE: This is getting handled in relay, so scoping this down to just the below.

It also corrects two places where we were sending the key ty rather than type (which works, but will now cause a warning).

@lobsterkatie lobsterkatie requested a review from untitaker Oct 20, 2020
@untitaker
Copy link
Member

@untitaker untitaker commented Oct 21, 2020

We should do this on the server imo, and fix the UI if it's overwhelming. This just adds overhead to the SDK for the happy path where the breadcrumb is valid.

@lobsterkatie
Copy link
Member Author

@lobsterkatie lobsterkatie commented Oct 21, 2020

We should do this on the server imo, and fix the UI if it's overwhelming. This just adds overhead to the SDK for the happy path where the breadcrumb is valid.

Happy to have this supplanted by a server fix. Will hold off on merging this until we can talk again about potentially doing that (cc @jan-auer).

EDIT: Converting to a draft so it's clear it's not to be merged yet, if at all.

@lobsterkatie lobsterkatie marked this pull request as draft Oct 21, 2020
@jan-auer
Copy link
Member

@jan-auer jan-auer commented Oct 28, 2020

@lobsterkatie What is it that you would like the server to emit exactly? If I'm reading this right, it looks like normalization errors for unknown breadcrumb keys, is that correct?

@lobsterkatie
Copy link
Member Author

@lobsterkatie lobsterkatie commented Oct 29, 2020

We have other places where if you send bogus data, you get one of those pink boxes at the top of the event detail page, with an error along the lines of "Invalid value for xxxxxxx: _____". Given that people can do literally anything they want to an event in beforeSend, I agree that warning on every schema error might be a bit much (though maybe still helpful on the balance, who knows), but in the case of breadcrumbs, we actively give people a way to provide their own data (addBreadcrumb) and so it seems like that might be a place where it's worth it to let people know if what they're sending it getting dropped on ingestion.

So, to answer your question - yes, that's correct.

@lobsterkatie lobsterkatie force-pushed the kmclb-warn-on-invalid-breadcrumb-keys branch from 6ef8f50 to a72e864 Compare Oct 30, 2020
@lobsterkatie lobsterkatie marked this pull request as ready for review Oct 30, 2020
@lobsterkatie lobsterkatie changed the title feat(breadcrumbs): Warn on invalid breadcrumb keys fix(breadcrumbs): Make all auto-generated breadcrumbs follow spec Oct 30, 2020
@untitaker
Copy link
Member

@untitaker untitaker commented Nov 2, 2020

do we still need this if the server now does some validation?

@lobsterkatie
Copy link
Member Author

@lobsterkatie lobsterkatie commented Nov 3, 2020

do we still need this if the server now does some validation?

At this point it's just fixing the SDK to follow spec - any reason not to do that?

@lobsterkatie lobsterkatie force-pushed the kmclb-warn-on-invalid-breadcrumb-keys branch from a72e864 to 8f53a99 Compare Nov 3, 2020
@untitaker
Copy link
Member

@untitaker untitaker commented Nov 3, 2020

Ah yes, sure.

@untitaker untitaker merged commit 549b7df into master Nov 3, 2020
3 checks passed
@untitaker untitaker deleted the kmclb-warn-on-invalid-breadcrumb-keys branch Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants