Expand description
Log-message normalization and stable signature hashing. Message normalization for error signature detection.
normalize_template collapses variable log message parts (timestamps,
IPs, IDs, hashes, numbers, JSON values, quoted strings, paths) into fixed
placeholders so that repeated error patterns map to a single canonical
template and, from that, a stable SHA-256 signature hash.
Design constraints:
- No regex pipeline — pure byte/char scanner for hot-path performance.
- Must handle multi-byte UTF-8 without splitting codepoints.
- JSON pre-pass is highest priority (before any other replacements).
NORMALIZER_VERSION must be bumped whenever the output of
normalize_template changes so that stale rows in error_signatures are
not confused with new ones.
Constants§
- NORMALIZER_
VERSION - Bump this whenever
normalize_template’s output changes for any input.
Functions§
- normalize_
template - Normalise a message into a template by replacing variable runs with placeholders.
- signature_
hash - Compute a stable SHA-256 hex digest of a normalized template.