open-telemetry / open-telemetry/opentelemetry-ruby

Implement `maxExportBatchSize` on the periodic reader

Open Beginner friendly
#2,369 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement metrics spec-compliance spec:development
Dominant language
Ruby
Stars
606
Forks
301
Avg merge
3d 19h
Merged PRs (30d)
42

Description

Spec requirement

[Development] The periodic exporting MetricReader SHOULD support a maxExportBatchSize parameter with in-order, non-combined batch splitting (sdk.md:1540-1584, Periodic exporting MetricReader).

Current behavior

export/periodic_metric_reader.rb:25-26 (permalink) correctly reads OTEL_METRIC_EXPORT_INTERVAL/OTEL_METRIC_EXPORT_TIMEOUT with the right 60000/30000 defaults, and :125 (permalink) synchronizes Export calls correctly, but maxExportBatchSize doesn't exist. Every collected batch is sent as one Export call (:126-127 (permalink)), so batch splitting isn't possible.

Suggested fix

Add a max_export_batch_size: option and split each collected batch into ordered, non-combined chunks of at most that size before calling Export once per chunk.

Related rows in SPEC_COMPLIANCE_METRICS.md

SDK-57

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in metrics_sdk/lib/opentelemetry/sdk/metrics/export/periodic_metric_reader.rb, especially the Export call around lines 125-127, and compare its behavior with the linked metrics SDK specification. Done means the reader accepts max_export_batch_size and sends collected data in ordered, non-combined chunks no larger than that size; verify the periodic reader's existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
observability-sre
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.