Skip to content

feat(bench): upload Prometheus metrics concurrently - #203

Open
decofe wants to merge 2 commits into
mainfrom
centaur/parallel-metrics-uploads-1788966464
Open

decofe wants to merge 2 commits into
mainfrom
centaur/parallel-metrics-uploads-1788966464

Conversation

@decofe

@decofe decofe commented Sep 9, 2026

Copy link
Copy Markdown
Member

Final-report Prometheus uploads currently wait for each HTTP request to finish before sending the next; baseline-1 in this benchmark run spent roughly ten minutes exporting 375 batches. Partition samples by exported metric name and sanitized labels into bounded upload shards, allowing independent series to upload concurrently while preserving each series' input order across requests.

PROMETHEUS_UPLOAD_WORKERS defaults to 4; set it to 1 for serial uploads. Encoding remains capped by PROMETHEUS_ENCODE_WORKERS, queues apply backpressure, and HTTP/encoding failures fail finalization. The real-time forwarder is unchanged.

Validation:

  • cargo test -p bench-core: 113 existing tests passed.
  • cargo +nightly fmt --all --check
  • cargo +nightly clippy -p bench-core --all-targets -- -D warnings

The multi-region benchmark has not been rerun with this change; live speedup depends on series distribution and endpoint capacity.

Prompted by: @shekhirin

Co-authored-by: Derek Cofausper <256792747+decofe@users.noreply.github.com>
Co-authored-by: Derek Cofausper <256792747+decofe@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants