Skip to content

fix(error-tracking): always use arity when formatting stacktrace frames#122

Open
martosaur wants to merge 1 commit into
PostHog:mainfrom
martosaur:am-anon-functions-arity
Open

fix(error-tracking): always use arity when formatting stacktrace frames#122
martosaur wants to merge 1 commit into
PostHog:mainfrom
martosaur:am-anon-functions-arity

Conversation

@martosaur
Copy link
Copy Markdown
Contributor

💡 Motivation and Context

This PR replaces #119

The problem is that PostHog Error Tracking uses resolved function name as part of the fingerprint for issue grouping. This is fine, but in Elixir SDK function name comes from the stacktrace frames, which are formatted using Exception.format_mfa(module, function, arity_or_args). arity_or_args is exactly that: arity or args. When it's arity, it's a simple integer that is stable across all calls. But when it's args, it's a dynamic value. So when included in the fingerprint, it prevents errors from grouping.

The solution in this PR is to always use arity for formatting, even if we are passed arguments.

💚 How did you test it?

Unit and integration tests

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran sampo add to generate a changeset file

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 27, 2026

Reviews (1): Last reviewed commit: "fix(error-tracking): always use arity wh..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant