feat(errors): Store error metadata for sorting #27157
Draft
+159
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
We want to fetch errors from pg for a faster load time. This involves having some estimates for sorting based on count and last seen.
This PR:
I opted not to directly write to pg from cymbal because this can easily overwhelm db writes i think, since we'll be writing on every event.
Also didn't try too much (yet) to keep the redis nos consistent, and think we should anyway have a sync to update these estimates to be more accurate nightly. This is probably also needed to help keep accurate counts for merges/splits/issue overrides.
Changes
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?