Skip to content

6/6 Support gzipped OTLP ingest requests#2139

Open
gareth-ellis wants to merge 6 commits into
masterfrom
otlp-pr6-gzip-wire
Open

6/6 Support gzipped OTLP ingest requests#2139
gareth-ellis wants to merge 6 commits into
masterfrom
otlp-pr6-gzip-wire

Conversation

@gareth-ellis
Copy link
Copy Markdown
Member

@gareth-ellis gareth-ellis commented May 29, 2026

Summary

Adds an optional gzip operation parameter that turns on Content-Encoding: gzip for OTLP ingest.

Records are pre-compressed at prepare-track time into a sibling .pbgz corpus file (each record independently gzipped). The benchmark hot path ships those bytes verbatim — no in-process compression, no decompress/recompress. Operations sharing a corpus can opt in independently; when a corpus has both gzip and non-gzip consumers, Rally generates both .pb and .pbgz.

Measured impact: ~12% throughput improvement against an ES cluster where coordinator-bytes backpressure is the bottleneck (gzip reduces decompressed body size accounted against the bucket).

Depends on #2138 — merge after #2138 (which in turn depends on #2135, #2136, #2137). Part 6 of 6, completes the OTLP ingest series.

Series

Test plan

  • New tests: gzip flag toggles .pbgz path, body bytes are gzip-magic-prefixed, Content-Encoding header set correctly
  • All 321 OTLP tests green
  • pre-commit clean

🤖 Generated with Claude Code

gareth-ellis and others added 6 commits May 29, 2026 14:41
The ApiError handler in execute_single() decodes `e.body`, `e.error`, and
`e.info` as UTF-8 to build a human-readable error message. When the body is
binary (e.g., binary protobuf returned by ES OTLP endpoints on 4xx/5xx), the
strict decode raises UnicodeDecodeError, which crashes the worker mid-task.

Switch the six decode() calls to use errors="replace" so undecodable bytes
become U+FFFD instead of aborting the worker. No semantic change for valid
UTF-8 (the common case).

This is a latent bug independent of OTLP — any operation that surfaces a
binary error body would have hit it.
Introduces OtlpProtobufFile in esrally/utils/io.py for reading/writing
length-prefixed OTLP ExportMetricsServiceRequest protobufs, plus an
offset sidecar to allow worker partitions to seek without scanning.

Wires preparation into esrally/track/loader.py and esrally/track/track.py:
- New OTLP document set fields (otlp_pb_size_in_bytes, etc.)
- prepare_otlp_document_set tries to download a .pb from the corpus base
  URL, otherwise converts a local JSON corpus to .pb on disk.
- set_absolute_data_path picks up the .pb when present.

Adds OTLP protobuf bindings to pyproject.toml (opentelemetry-proto).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
OtlpParamSource streams length-prefixed protobuf records out of an
OtlpProtobufFile, partitions them across workers using the offset
sidecar, and surfaces percent_completed so the progress bar tracks
real progress. Supports a "looped" mode that cycles the partition
indefinitely for time-bound benchmarks.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
OtlpIngest POSTs serialized protobuf bytes to the OTLP metrics
endpoint, disabling transport-level fast retries in favour of an
explicit exponential-with-full-jitter backoff loop. 429/502/503/504
and connection errors are retried; non-retryable ApiErrors return a
failure dict so the driver records the error without crashing the
worker.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…lable

Adds two perf improvements for OTLP corpora that don't change the
on-the-wire benchmark behaviour:

1. Parallel .pb generation. OtlpProtobufFile.create() now uses a
   ProcessPoolExecutor pipeline (worker count tunable via
   RALLY_OTLP_CONVERSION_WORKERS) so converting a multi-GB JSON
   corpus completes in minutes instead of hours.

2. Compressed .pb download. When the JSON corpus is published in a
   compressed archive, prepare-track first tries the matching
   compressed .pb (e.g. .pb.zst) from the corpus URL and decompresses
   locally — typically 2-4x less network bytes than the raw .pb.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds a "gzip" operation parameter that turns on Content-Encoding: gzip
for OTLP ingest. Records are pre-compressed at prepare-track time and
stored in a sibling .pbgz corpus file, so the benchmark hot path ships
the bytes verbatim with no in-process compression. Operations sharing a
corpus can opt in independently — Rally generates both .pb and .pbgz
when needed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant