Skip to content

Conversation

@kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek commented Nov 23, 2022

Fold multiple consecutive occurrences of the same property name into a single group, excluding the last component.

foo | foo
foo.foo | foo.foo
foo.foo.foo | {foo#2}.foo
bar.foo.foo | bar.foo.foo
bar.foo.foo.foo | bar.{foo#2}.foo
bar.foo.foo.onError | bar.{foo#2}.onError
bar.bar.bar.foo.foo.onError | {bar#3}.{foo#2}.onError
bar.foo.foo.bar.bar.onError | bar.{foo#2}.{bar#2}.onError

This is mostly done for React, where some frames have function name like <object>.children.children.children.onSubmitError when function is a prop passed down the component stack.

Copy link
Member

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, though I thought you wanted to do that as part of the UI?
I think native does have some kind of function name cleaning going on, and you can toggle in the UI if you want to have clean functions or full functions. The clean version is used for grouping there.

@kamilogorek
Copy link
Contributor Author

Asked @mitsuhiko and he pointed out that we can do it here instead of in the UI.
I've seen there's normalize_stacktraces_for_grouping which does the trimming as well, but Im not sure what are the consequences of it.
It'd be great to get an input from @untitaker or @jan-auer as well.

def format_groups(p):
if len(p) == 1:
return p[0]
return f"\u007b{p[0]}#{len(p)}\u007d"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with that but for the record you can do f"{{{p[0]}#{len(p)}}}".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need more cowbell braces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replit was not happy about this syntax for some reason, so I went with codes directly

image

@mitsuhiko
Copy link
Contributor

I prefer this being done in ingestion so the response from the API is consistent everywhere including emails, notifications and whatnot.

@kamilogorek kamilogorek merged commit 8078d89 into master Nov 24, 2022
@kamilogorek kamilogorek deleted the group-fn-name-parts branch November 24, 2022 10:22
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants