fix(logs): staging fidelity fixes — tabs, newlines, Unicode positions, UTF-8 safety#49810
Draft
DDuongNguyen wants to merge 1 commit intojsaf/json-encode-strings-fixfrom
Draft
fix(logs): staging fidelity fixes — tabs, newlines, Unicode positions, UTF-8 safety#49810DDuongNguyen wants to merge 1 commit intojsaf/json-encode-strings-fixfrom
DDuongNguyen wants to merge 1 commit intojsaf/json-encode-strings-fixfrom
Conversation
Contributor
Author
Contributor
Go Package Import DifferencesBaseline: a903409
|
This was referenced Apr 24, 2026
Draft
…, UTF-8 safety
Template reconstruction mismatches found in staging (flink-intakeshadow-metrics).
Pattern template fixes (pattern.go):
1. \t/\n/\r preserved — sanitizeForTemplateInto was stripping tab (0x09 < 0x20),
newline, and carriage return. Fixes DNS records, ctr progress logs, ECR pulls,
xDS ADS request bodies with pretty-printed JSON, curl output.
2. Trailing whitespace tokens no longer dropped — GetPatternString was skipping
tokens where sanitizeForTemplateInto returned 0, silently losing trailing spaces.
3. Unicode rune positions — GetWildcardCharPositions emitted byte offsets; Java
server expects UTF-16 code unit counts. Add sanitizeForTemplateRuneLen.
Proto safety (mock_state.go):
4. toValidUTF8 — proto3 string fields require valid UTF-8. Invalid bytes in
wildcard values or raw log content would corrupt or silently drop datums.
Applied in fillDynamicValue (string_value) and sendRawLog.
Preprocessor alignment (preprocessor/json.go):
5. JSONContextValues changed []string → []interface{} to match processor/json.go.
Preserves native JSON types (numbers as numbers, not strings) for correct
transport-layer encoding.
All fixes include regression tests using exact strings from production staging logs.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
0165d0a to
85b5f31
Compare
5d3e3e6 to
13c88a0
Compare
This was referenced Apr 27, 2026
Draft
Draft
Draft
This was referenced Apr 29, 2026
Draft
Draft
This was referenced May 8, 2026
Draft
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 does this PR do?
Motivation
Describe how you validated your changes
Additional Notes