Repository navigation
fix: the translator no longer panics on a label name holding its key-list separator bytes - #761
Conversation
…list separator bytes A label filter after | json or | logfmt whose name starts with the byte 0x01 was read as a name_extracted key list and indexed an empty slice; a name holding 0x00 was split into two keys. Such names are now translated as plain names. The request path already rejects these queries with Loki's parse error, so only direct translator callers were affected.
⚪ Performance A/B: no change beyond noise105 shape×range — 105 ⚪ same · results vs Loki: 88 same, 0 new difference(s), 17 pre-existing Every shape is within noise of the base build (±30% and 100 ms). 105 unchanged shape×range (within noise)
Cold (first-run) timings — what a user opening a panel sees
Why these shapes
base |
PR Quality ReportCompared against base branch Coverage and tests
Compatibility
Performance smokeLower CPU cost (
State
|
✅ Visual smoke: passedBase
Gate: a base-vs-PR data difference passes when the PR is closer to Loki, and fails when the PR diverges from Loki or Loki cannot decide it (at a range Loki does not hold, a difference passes when the same page proved it closer to Loki at a shorter range; otherwise label the pull request Core set montages (5): base | PR | Lokidd-fields-1h dd-landing-1h dd-service-logs-1h explore-logs-plain-1h explore-metric-plain-1h All montages of this run: |





Summary
FuzzTranslateWithStreamFieldsfound a panic in the query translator (CI fuzz-smoke):The translator encodes the candidate keys of a sanitized label as one string: keys are joined by
\x00, and aname_extractedcollision candidate is marked with a leading\x01. A label name that itself held those bytes was decoded as a key list: a leading\x01recursed past the end of the list, and an inner\x00split one name into two keys.withParsedKeyVariantsleaves a name holding either byte as a plain name.translateSingleLabelFiltersplits the translation into keys only when the label name itself holds no separator.Client impact
None. The request path validates the query with the Loki grammar first and answers Loki's parse error (
400) for these names, so only direct translator callers (and the fuzz target) could reach the panic.Tests
TestParsedKeyFilterNameWithSeparatorBytes: panics onmain, passes here.FuzzTranslateWithStreamFieldsfor 60 s locally: pass.go test -short ./internal/translator ./internal/proxy, golangci-lint, the changelog and conformance gates: pass.No change to translated queries for valid label names, so no A/B or e2e run.