feat(bench): restore OTLP envelope 1:1 mapping + kvlist fixture (PR-L2) - #63
Conversation
PR-K4 stripped `attributes` / `resource_attributes` in the bench loader and removed the kvlist record from the committed OTLP fixture, both as workarounds for the deferred RFC 0005 §3.3 canonicalisation. PR-L1 (#62) landed the canonicalisation encoders/decoders end-to-end, so the workarounds can go: - `map_log_record` no longer empties `attributes` / `resource_attributes`; both fields map verbatim from the wire per RFC 0003 §6.6. The resource-attrs per-`ResourceLogs` hoist is restored alongside. - `crates/ourios-bench/tests/data/otlp/sample.jsonl` regains its kvlist body record; the fixture is now 3 LogsData lines / 4 records (1 + 2 + 1) as PR-K2 originally shipped it. - Loader test reverts: `loads_otlp_corpus_envelope_one_to_one` asserts `first.attributes.len() == 1` and `first.resource_attributes.len() == 2` again, and the structured-body test reads the fixture's 4th record (the inline-synthetic workaround test goes away too). - Module / `ingest_otlp_jsonl` / `map_log_record` rustdocs lose the "stripped pending §3.3" caveats now that the writer carries the envelope through. Local end-to-end on the restored fixture: 4 records ingest + write + read cleanly. C1 = 1.000000 (3/3 non-lossy strings; the kvlist record is correctly excluded from C1's denominator per RFC 0001 §6.4 — that exclusion landed in PR-K4 and stays). Test plan: cargo fmt / clippy / test --all-features (292 passed / 19 ignored, same count: -1 inline-synthetic test, +1 fixture-restored assertion). `mdbook build` clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR modifies the OTLP/JSON Lines corpus loader to preserve LogRecord attributes and resource attributes by hoisting resource attributes once per ChangesOTLP Attribute Preservation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Reverts the PR-K4 workarounds now that RFC 0005 §3.3 canonical-JSON encoding (PR #62) has landed: the bench OTLP loader restores 1:1 envelope mapping including attributes / resource_attributes, and the committed fixture regains its kvlist body record.
Changes:
map_log_recordmapsattributes/resource_attributesfrom the wire and hoistsResource.attributesperResourceLogsgroup.- Sample fixture gains the kvlist record (3 lines / 4 records).
- Loader tests assert the rich envelope; the inline-synthetic structured-body test reverts to a fixture-driven assertion. Docs drop the "stripped pending §3.3" caveats.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
crates/ourios-bench/src/corpus.rs |
Restore resource-attr hoist + 1:1 attribute mapping; update doc comments and tests. |
crates/ourios-bench/tests/data/otlp/sample.jsonl |
Add third LogsData line containing a kvlistValue body record. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Direct follow-up to PR #62 (RFC 0005 §3.3 canonicalisation). PR-K4 had stripped
attributes/resource_attributesin the bench loader and removed the kvlist body record from the committed OTLP fixture as workarounds for the deferred §3.3 encoder. Canonicalisation now ships, so the workarounds go:map_log_recordmapsattributes/resource_attributes1:1 from the wire per RFC 0003 §6.6 (the resource-attrs per-ResourceLogshoist is back).crates/ourios-bench/tests/data/otlp/sample.jsonlregains its kvlist body record — back to 3 lines / 4 records.ingest_otlp_jsonl/map_log_recordrustdocs drop the "stripped pending §3.3" caveats.End-to-end on the restored fixture
C1 is 3/3 (not 4/4) because the kvlist record is correctly excluded from C1's denominator per RFC 0001 §6.4 — that exclusion landed in PR-K4 and remains semantically right (template-based reconstruction doesn't apply to structured bodies).
Test plan
cargo fmt --all --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-features— 292 passed / 19 ignored (same count: −1 inline-synthetic structured-body test, +1 restored fixture assertion).mdbook buildclean.ourios-benchend-to-end on the restored fixture (above).What the bench can now do
Triggering
Benchwithcorpus_dir=crates/ourios-bench/tests/data/otlpin CI now exercises every column shape the §3.2 schema admits: scalar primitives, scope, attribute KV lists, resource-attribute KV lists, structured kvlist body. End of the "stripped envelope" caveat for the on-disk corpus path. The production OTLP receiver (RFC 0003 §6.5) is still gated onourios-wal; that's a separate multi-RFC arc.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests