Skip to content

fix: relax metadata fallback on empty strict scans and harden extract literals#225

Merged
szibis merged 1 commit intomainfrom
codex/drilldown-metadata-relax-fallback
Apr 20, 2026
Merged

fix: relax metadata fallback on empty strict scans and harden extract literals#225
szibis merged 1 commit intomainfrom
codex/drilldown-metadata-relax-fallback

Conversation

@szibis
Copy link
Copy Markdown
Collaborator

@szibis szibis commented Apr 20, 2026

Summary

  • relax detected labels/fields discovery when strict candidate returns a successful-but-empty response
  • retry native streams/field-name metadata lookups with relaxed candidates when strict lookup is empty
  • harden translator so pattern/extract stages without named captures become line filters instead of invalid extract pipes
  • update tests to assert relaxed fallback behavior and literal-extract translation behavior

Why

  • Drilldown metadata endpoints can intermittently return empty data when a strict candidate has no rows but a relaxed candidate does
  • VictoriaLogs rejects extract "Metrics" because the pattern has no named field placeholder

Validation

  • go test ./internal/translator ./internal/proxy
  • local compose backend repro against seeded data:
    • strict query ... | json | source_message_bytes="999" now returns non-empty detected_labels and detected_fields
    • repeated calls are stable (zero=0 nonzero=20 for both labels and fields)
    • direct backend query with | extract "Metrics" | stats by (level) rate() still reproduces the parser error, while proxy-side literal extract translation no longer surfaces that parser failure

@github-actions github-actions bot added size/M Medium change scope/translator LogQL translator scope/proxy Proxy core scope/tests Tests bugfix Bug fix labels Apr 20, 2026
@szibis szibis force-pushed the codex/drilldown-metadata-relax-fallback branch from abbb6f1 to 959bd03 Compare April 20, 2026 18:32
@github-actions github-actions bot added size/M Medium change scope/docs Documentation and removed size/M Medium change labels Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 20, 2026

PR Quality Report

Compared against base branch main.

Coverage and tests

Signal Base PR Delta
Test count 1809 1811 2
Coverage 89.3% 89.2% -0.1% (stable)

Compatibility

Track Base PR Delta
Loki API 100.0% 11/11 (100.0%) 0.0% (stable)
Logs Drilldown 100.0% 17/17 (100.0%) 0.0% (stable)
VictoriaLogs 100.0% 11/11 (100.0%) 0.0% (stable)

Compatibility components

Track Component Base PR Delta
Loki API label_values 2/2 (100.0%) 2/2 (100.0%) 0.0% (stable)
Loki API labels 4/4 (100.0%) 4/4 (100.0%) 0.0% (stable)
Loki API metrics 2/2 (100.0%) 2/2 (100.0%) 0.0% (stable)
Loki API otel 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)
Loki API query_range 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)
Loki API series 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)
Logs Drilldown detected_fields 11/11 (100.0%) 11/11 (100.0%) 0.0% (stable)
Logs Drilldown label_values 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)
Logs Drilldown level_volume 2/2 (100.0%) 2/2 (100.0%) 0.0% (stable)
Logs Drilldown patterns 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)
Logs Drilldown service_logs 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)
Logs Drilldown service_selection 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)
VictoriaLogs detected_fields 4/4 (100.0%) 4/4 (100.0%) 0.0% (stable)
VictoriaLogs field_values 3/3 (100.0%) 3/3 (100.0%) 0.0% (stable)
VictoriaLogs index_stats 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)
VictoriaLogs stream_translation 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)
VictoriaLogs synthetic_labels 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)
VictoriaLogs volume_range 1/1 (100.0%) 1/1 (100.0%) 0.0% (stable)

Performance smoke

Lower CPU cost (ns/op) is better. Lower benchmark memory cost (B/op, allocs/op) is better. Higher throughput is better. Lower load-test memory growth is better. Benchmark rows are medians from repeated samples.

Signal Base PR Delta
QueryRange cache-hit CPU cost 1370.0 ns/op 1355.0 ns/op -1.1% (stable)
QueryRange cache-hit memory 200.0 B/op 200.0 B/op 0.0% (stable)
QueryRange cache-hit allocations 7.0 allocs/op 7.0 allocs/op 0.0% (stable)
QueryRange cache-bypass CPU cost 1665.0 ns/op 1644.0 ns/op -1.3% (stable)
QueryRange cache-bypass memory 274.0 B/op 271.0 B/op -1.1% (stable)
QueryRange cache-bypass allocations 7.0 allocs/op 7.0 allocs/op 0.0% (stable)
Labels cache-hit CPU cost 681.1 ns/op 700.8 ns/op +2.9% (stable)
Labels cache-hit memory 48.0 B/op 48.0 B/op 0.0% (stable)
Labels cache-hit allocations 3.0 allocs/op 3.0 allocs/op 0.0% (stable)
Labels cache-bypass CPU cost 841.1 ns/op 841.4 ns/op +0.0% (stable)
Labels cache-bypass memory 53.0 B/op 53.0 B/op 0.0% (stable)
Labels cache-bypass allocations 3.0 allocs/op 3.0 allocs/op 0.0% (stable)
High-concurrency throughput 116883.0 req/s 99368.0 req/s -15.0% (stable)
High-concurrency memory growth 0.4 MB 0.4 MB 0.0% (stable)

State

  • Coverage, compatibility, and sampled performance are reported here from the same PR workflow.
  • This is a delta report, not a release gate by itself. Required checks still decide merge safety.
  • Performance is a smoke comparison, not a full benchmark lab run.
  • Delta states use the same noise guards as the quality gate (percent + absolute + low-baseline checks), so report labels match merge-gate behavior.

@szibis szibis merged commit 77a7cb4 into main Apr 20, 2026
44 checks passed
@szibis szibis deleted the codex/drilldown-metadata-relax-fallback branch April 20, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fix scope/docs Documentation scope/proxy Proxy core scope/tests Tests scope/translator LogQL translator size/M Medium change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant