Implement OTLP protobuf encoder#63
Conversation
|
Choir: GitHub Actions rollup reports all checks successful on the latest head — re-check review/merge policy on GitHub (not an approval or merge signal by itself). |
There was a problem hiding this comment.
Pull request overview
This PR adds OTLP protobuf encoding support to the src/otlp/transport layer by implementing a ProtobufEncoder that emits ExportTraceServiceRequest / ExportLogsServiceRequest protobuf bytes using moonbitlang/protobuf, along with round-trip structural decoder tests and a golden-byte fixture to validate wire-format correctness.
Changes:
- Add
moonbitlang/protobuf@0.1.1as a dependency and import it in the OTLP transport package. - Implement OTLP trace/log protobuf encoding (field mappings + primitive writer helpers) and introduce
EncodingError::ProtobufEncodeFailedfor structured failures. - Add extensive protobuf decode-based tests plus a golden bytes assertion for a representative trace request; update protobuf design documentation accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/otlp/transport/encoding.mbt | Implements OTLP protobuf writer helpers, trace/log request encoders, and a new structured encoding error. |
| src/otlp/transport/encoding_test.mbt | Adds structural protobuf decoders + assertions for traces/logs, a golden bytes test, and error-path validation. |
| src/otlp/transport/moon.pkg | Imports moonbitlang/protobuf so transport code/tests can use protobuf writer/reader APIs. |
| moon.mod | Adds moonbitlang/protobuf@0.1.1 dependency. |
| src/otlp/transport/pkg.generated.mbti | Updates the public interface to include the new ProtobufEncodeFailed error variant. |
| docs/otlp-protobuf-design.md | Updates the design doc to reflect the implemented hand-rolled OTLP subset approach and runtime version. |
|
Choir: GitHub Copilot issue-thread comment observed on PR — parent notified with updated gate snapshot (not merge approval). |
Summary
TDD
Wire-format audit note
Verification
No dependency on ryota0624/opentelemetry_proto_mbt or protoc-gen-mbt.
Verification
Generated by Choir from commands executed in the leaf workspace.
moon fmt --checkmoon test --target nativemoon build --target native --release