Repository navigation
Support PeriodicMetricReader maxExportBatchSize in autoconfigure - #8935
Conversation
Pull request dashboard statusMerged · refreshed 2026-10-28 21:16 UTC Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8935 +/- ##
============================================
- Coverage 90.43% 90.42% -0.01%
- Complexity 10908 10909 +1
============================================
Files 1015 1015
Lines 29854 29858 +4
Branches 3901 3902 +1
============================================
+ Hits 26998 26999 +1
- Misses 1907 1908 +1
- Partials 949 951 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Couple of thoughts:
|
Let me know your thoughts on this. cc: @jack-berg , @dashpole |
This comment has been minimized.
This comment has been minimized.
Just waiting on the spec PR to officially support the proposed env var here. Once this PR is merged, we should be ok to merge this. |
9bc1f69 to
582ff05
Compare
|
Hey @jack-berg, the spec PR to officially support the proposed env var got merged. I believe this PR is ready for review / merge now. |
…MetricReader (open-telemetry#5359) Fixes open-telemetry#5358 ## Changes Adds the `OTEL_METRIC_EXPORT_MAX_BATCH_SIZE` environment variable to the [Periodic exporting MetricReader section of the Environment Variable Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#periodic-exporting-metricreader) to configure the [`maxExportBatchSize`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#periodic-exporting-metricreader) option (stabilized in open-telemetry#5291). For non-trivial changes, follow the [change proposal process](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CONTRIBUTING.md#proposing-a-change). * [x] Related issues open-telemetry#5358 * [ ] Related [OTEP(s)](https://github.com/open-telemetry/oteps) # * [x] Links to the prototypes (when adding or changing features) * Java: open-telemetry/opentelemetry-java#8935 * [x] [`CHANGELOG.md`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/CHANGELOG.md) file updated for non-trivial changes * For trivial changes, include `[chore]` in the PR title to skip the changelog check * [x] [Spec compliance matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix/template.yaml) updated if necessary * [x] [Declarative config data model](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/data-model.md#overview) is updated if SDK config surface is changed
jack-berg
left a comment
There was a problem hiding this comment.
Thanks for following up and working through the spec 👍
Summary
Adds support for configuring
PeriodicMetricReaderBuilder#setMaxExportBatchSizeinopentelemetry-sdk-extension-autoconfigurevia theotel.experimental.metric.export.max.batch.sizesystem property (OTEL_EXPERIMENTAL_METRIC_EXPORT_MAX_BATCH_SIZEenvironment variable).Motivation / Justification
PeriodicMetricReaderBuilder#setMaxExportBatchSizewas added in #8296 and stabilized in #8829, and is supported in declarative configuration viamax_export_batch_size/development. However, users relying on environment variable / system property autoconfiguration (such as zero-code OpenTelemetry Javaagent users or Spring Boot starter users) currently have no way to configure metric export batching:otel.java.metrics.cardinality.limit) can hit OTLP payload / gRPC message size limits or collector/backend ingestion limits per export request without batching.max_export_batch_size/developmentonPeriodicMetricReaderModel, so declarative config remains a strict superset of env var / system property configuration./developmentinopentelemetry-configuration), it is namespaced underotel.experimental.*to avoid locking in a stable property name prematurely.Fix: #8936