Skip to content

2/6 Add OTLP binary protobuf core IO and track preparation#2135

Open
gareth-ellis wants to merge 3 commits into
masterfrom
otlp-pr2-core-io
Open

2/6 Add OTLP binary protobuf core IO and track preparation#2135
gareth-ellis wants to merge 3 commits into
masterfrom
otlp-pr2-core-io

Conversation

@gareth-ellis

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

Copy link
Copy Markdown
Member

Summary

Adds the foundation for OTLP (OpenTelemetry Protocol) corpora in Rally:

  • OtlpProtobufFile in esrally/utils/io.py: reads/writes length-prefixed ExportMetricsServiceRequest protobufs, with a sidecar .offset file so worker partitions can seek without rescanning the corpus.
  • prepare_otlp_document_set in esrally/track/loader.py: downloads a pre-built .pb from the corpus base URL when available, otherwise converts a local JSON corpus on disk.
  • New OTLP document-set fields in esrally/track/track.py, opentelemetry-proto dependency in pyproject.toml.

Part 2 of 6 in the OTLP ingest series. Standalone — no dependencies on other PRs in the series.

Series

Test plan

  • 146 unit tests covering OtlpProtobufFile read/write/offset behaviour and the loader's prepare-track flow
  • pre-commit clean (pyupgrade, black, isort, mypy, pylint)

🤖 Generated with Claude Code

gareth-ellis and others added 2 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>
@gareth-ellis gareth-ellis requested a review from a team as a code owner May 29, 2026 14:10
@gareth-ellis gareth-ellis changed the base branch from otlp-pr1-driver-utf8 to master May 29, 2026 14:31
@gareth-ellis gareth-ellis changed the title Add OTLP binary protobuf core IO and track preparation 2/6 Add OTLP binary protobuf core IO and track preparation May 29, 2026
Comment thread esrally/driver/driver.py
# Some runners return a raw response, causing the 'error' property to be a string literal of the bytes/BytesIO object,
# we should avoid bubbling that up
# e.g. ApiError(413, '<_io.BytesIO object at 0xffffaf146a70>')
# errors="replace" so binary response bodies (e.g. OTLP ingest returns binary protobuf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this part already merged into master in #2134?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.....since each builds on each other each pr contains those changes from the previous. Once one is merged we can update branch to exclude the already merged changes

@gareth-ellis

Copy link
Copy Markdown
Member Author

@elasticmachine update branch

Copilot AI review requested due to automatic review settings June 16, 2026 17:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@ebadyano ebadyano self-requested a review June 17, 2026 16:02

@ebadyano ebadyano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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.

4 participants