fix(ingester): template underscore-glued ids in message normalization - #3
Merged
Merged
Conversation
\b never fires between _ and a digit (both word chars), so ids like prj_1013 / user_42 / order_9f3ac2d144 escaped NUMBER_RE and LONG_HEX_RE entirely — one defect fragmented into an issue per entity id and never crossed the incident threshold (observed live: 15 events → 15 one-event issues, no incident). Underscore-glued numbers/hex now template to _<n>/_<hex>; letter-glued tokens (sha256, utf8) stay literal on purpose. Generated-By: PostHog Code Task-Id: 6e0925be-ecd5-42ee-9fde-895c4678bde4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
\bnever matches between_and a digit (both are word characters), so underscore-glued ids —prj_1013,user_42,order_9f3ac2d144— escapedNUMBER_REandLONG_HEX_REentirely. One defect fragmented into a separate issue per entity id and never crossed the incident threshold.Observed live in the production smoke test: 15 identical
missing project (project prj_NNNN …)errors → 15 one-event issues → no incident.Fix
Two new templating passes before the generic number pass:
_[0-9a-f]{8,}→_<hex>_\d+(\.\d+)?→_<n>Letter-glued digits (
sha256,utf8,s3) deliberately stay literal — those are meaningful tokens, not per-entity ids. Verified: the 15 fragmented messages all normalize to one identical string;4200ms-style cases unchanged.Created with PostHog Code