Repository navigation
feat: accept OTLP/HTTP protobuf on the logs, metrics and traces endpoints - #156
Merged
Merged
Conversation
Ports upstream parseablehq/parseable 0de90cf. Addresses in 64:ff9b::/96 (RFC 6052) and 64:ff9b:1::/48 (RFC 8215) embed an IPv4 destination, so a target resolving to one could reach a private IPv4 address past the policy. They now need allow_private plus an allowlist match, like other private ranges. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… endpoints Ports the protobuf handling of upstream parseablehq/parseable 3767d38. Requests with Content-Type application/x-protobuf were rejected as unsupported. They are now decoded into the typed export request and flattened by the protobuf flatteners the crate already had, then staged through the same push_logs path, flatten budget and field-count check as OTLP JSON. A malformed body is a 400 and produces no rows. The payload limit the routes already apply is re-checked before decoding. prost goes from 0.13 to 0.14 to match the version opentelemetry-proto implements Message with; the lockfile only loses the unused 0.13 copy. Upstream's surrounding refactor of flatten_and_push_logs and its dataset-tag header handling are not part of this port. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…r review - A successful protobuf export now carries Content-Type application/x-protobuf, as OTLP/HTTP requires (the full-success response encodes to zero bytes). JSON responses are unchanged. - The decode error no longer repeats prost's own "failed to decode Protobuf message" prefix. - Drop the payload-size re-check: the routes' PayloadConfig rejects an oversized body with 413 before the handler runs, so it could not fire. Without it the handler-level content-type test for protobuf is back. - The truncation test claimed more than it proves: a body cut between two top-level entries is a valid shorter request. - The ingestion UI said protobuf has to be converted by a collector. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Compare the same typed fixtures in a release decode and flatten example and in paired local-store experiments. Record server instructions and CPU time, require SQL row and identity parity, and probe the OTLP HTTP contract. Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
…nst OTLP JSON Replaces the single hand-written differential test of 42a2191 with generated coverage of OtelProtobufRequest::{decode, flatten} and flatten_and_push_otel_protobuf, in a test-only child module of ingest_utils: - differential properties for logs, metrics and traces: protobuf encode/decode/flatten gives exactly the rows of OTLP JSON serialise/deserialize_otel_json/flatten, over requests the JSON mapping can carry, with every AnyValue variant, nesting, duplicate and reserved keys, all metric kinds with exemplars and flags, events, links, status, extreme ids, integers, timestamps and doubles; - robustness: arbitrary, truncated, mutated and wrong-signal bodies never panic, decode deterministically, and a body that does not decode is refused by the entry point with the decode error; - log flatten limits refuse the same requests with the same error and budget under both encodings; - a seeded scenario (DST_SEED, DST_ITERS) of mixed encodings, damage and limits through decode and flatten, with a row-count model, cross-encoding checks and a same-seed determinism check; - pinned tests of what the JSON path does with messages its mapping can not carry (non-finite doubles, empty AnyValue, strindex, silently dropped metrics, inexact doubles, nesting depth), and an ignored reproduction of a metrics flattener bug (metadata supplies the target_info timestamp). Nothing touches the PARSEABLE global. Larger runs: OTLP_PB_PROPTEST_CASES, OTLP_PB_PROPTEST_SEED. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The property and seeded tests were written against 42a2191. Since then the payload-size re-check was removed from flatten_and_push_otel_protobuf, and the metrics flatteners got their explicit-exemplar variants from the benchmark commit, so the tests use those and no longer exercise a size refusal. Also silence a clippy constant-assertion warning in the stage benchmark. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Protobuf costs the server 22-52% fewer instructions per record than OTLP JSON and its requests are 39-43% of the size, so the generated collector configurations now use it. The host-metrics scripts can be pointed at any server version, so they ask first: an empty protobuf export request to /v1/metrics is answered 200 by servers that accept protobuf and 400 by older ones. Anything but a 2xx (old server, bad key, unreachable, no curl) keeps `encoding: json`, which is what the scripts wrote before. PARSEABLE_OTLP_ENCODING=json or proto skips the check. The UI's collector.yaml is served by the server it will send to, so it uses `encoding: proto` directly. Its curl sample stays JSON. ingest.ps1 is not run here (no PowerShell on this machine); its check falls back to JSON on any error. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 24, 2026
The note under the generated setup said the configuration uses JSON for every OpenTelemetry source. The collector configuration now sends protobuf; say so, and keep JSON for the OTLP HTTP sample. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The collector setup page now shows encoding: proto and says so in its notes. The four baselines are the screenshots CI's pinned Playwright image produced for this branch; each differs from the old one only in the snippet's encoding line, the note under it and the OpenTelemetry side note. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
Description
Ports upstream parseablehq#1869 (
3767d384): the OTLP endpoints accept protobuf bodies as well as JSON.POST /v1/logs,/v1/metricsand/v1/tracesacceptContent-Type: application/x-protobuf. A protobuf request gets a protobuf response. JSON requests behave as before.scripts/ingest.shandscripts/ingest.ps1probe the server with an empty protobuf request and writeencoding: protoon success andencoding: jsonotherwise, so they still work against servers without this change.PARSEABLE_OTLP_ENCODING=json|protoskips the probe. The collector snippet in the UI usesencoding: proto.otel_protobuf_props.rs).scripts/ingest-performance/otlp*.pymeasures the cost of each encoding against a running server.The first commit is a separate upstream port (
0de90cf2): the alert target outbound policy blocks NAT64 prefixes.Measured
On a release build, protobuf takes 22–52% fewer server instructions per record than OTLP JSON, depending on the signal and record shape.
Verified
cargo test --lib: 1,450 passed, 0 failed.scripts/ingest.shchose protobuf against this server and JSON when forced; both datasets had the same 26 metric names and the same columns.Not verified
scripts/ingest.ps1was not run (no PowerShell available).Left out
Upstream's handling of the
X-P-Dataset-Tagsheader on these routes: #154.This PR has:
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.