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.

Assessment

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

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.

Description

enhancement metrics spec-compliance spec:development

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

Dominant language
Ruby
Stars
606
Forks
301
Avg merge
3d 19h
Merged PRs (30d)
42

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.

More from open-telemetry/opentelemetry-ruby

All issues in open-telemetry/opentelemetry-ruby

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.