Repository navigation
Require ForceFlush in periodic exporting MetricReader Shutdown - #5305
Conversation
|
I'm unsure if this change would require tracking on the compliance matrix, but will add if deemed so. |
There was a problem hiding this comment.
What about "prototypes"? What are the existing SDKs doing? I just found:
all languages, except C++ and Ruby, already implement this behaviour. Issues for those language repos will follow.
I'm unsure if this change would require tracking on the compliance matrix, but will add if deemed so.
Personally, I do not think this should be needed.
Check #2983 (comment) |
pellared
left a comment
There was a problem hiding this comment.
Just one suggestion #5305 (comment)
Co-authored-by: Robert PajΔ k <pellared@hotmail.com>
Pull request dashboard statusMerged Β· refreshed 2026-09-18 05:49 UTC Status above doesn't look right?
|
|
I'll merge this PR by the end of Sep. 18th, 2026 unless there is blocking concerns. |
### Traces - Add `Sampler.Shutdown` operation. ([open-telemetry#5335](open-telemetry#5335)) - Clarify that calls to the Development `SpanProcessor.OnEnding` method are not allowed after `Shutdown`. ([open-telemetry#5316](open-telemetry#5316)) ### Metrics - Specify that `Shutdown` of the periodic exporting MetricReader MUST include the effects of `ForceFlush`. ([open-telemetry#5305](open-telemetry#5305)) ### Logs - Add systemd-journald example mapping to the logs data model appendix and align syslog mapping. ([open-telemetry#4995](open-telemetry#4995)) ### Resource - Update resource detectors to generate entities and indicate resource detectors should be entity-aware unless new `OTEL_EXPERIMENTAL_ENTITIES_ENABLED != true`. ([open-telemetry#5147](open-telemetry#5147)) ### Entities - Add in-development entity-resource startup specification. ([open-telemetry#5057](open-telemetry#5057)) - Remove `OTEL_ENTITIES` from general env var configuration spec. ([open-telemetry#5147](open-telemetry#5147)) ### Common - Stabilize Attribute and Attribute Collection representation for non-OTLP. ([open-telemetry#5149](open-telemetry#5149)) ### OpenTelemetry Protocol - Clarify that the OTLP exporter timeout bounds the entire batch export, including all request attempts and waits between retries, and that earlier caller deadlines take precedence. ([open-telemetry#5347](open-telemetry#5347)) ### Compatibility - Stabilize Prometheus Unknown-typed metric transformation. ([open-telemetry#5213](open-telemetry#5213)) - Stabilize Prometheus Info metric transformation. ([open-telemetry#5211](open-telemetry#5211)) ### SDK Configuration - Declarative config should gracefully degrade when encountering unrecognized resource detectors. Other SDK plugin components continue to produce errors when missing. ([open-telemetry#5323](open-telemetry#5323)) ### Supplementary Guidelines - Allow narrowly scoped security-related changes to stable SDK and Contrib behavior, configuration defaults, supported values, and emitted telemetry without a major version bump, while preserving API compatibility and requiring release notes describing the security rationale, user impact, and migration. ([open-telemetry#5357](open-telemetry#5357)) ### OTEPs - Add OTEP proposing a top-level span type field in API, SDK, and OTLP. ([open-telemetry#5233](open-telemetry#5233))
Fixes #2983
Changes
Specifies that
Shutdownof the periodic exportingMetricReaderMUST include the effects ofForceFlush, so a final collection and export of pending metrics happens whenMeterProvider.Shutdown()is called, not just on an explicitForceFlush().Today, there's no requirement to flush pending data. This means metrics recorded shortly before an application exits can be silently dropped unless the caller separately calls
ForceFlush()beforeShutdown(). This change mirrors the existingSpanProcessor.Shutdown()andLogRecordProcessor.Shutdown(), which already state "ShutdownMUST include the effects ofForceFlush".As documented in #2983 (comment) all languages, except C++ and Ruby, already implement this behaviour. Issues for those language repos will follow.
CHANGELOG.mdfile updated for non-trivial changes[chore]in the PR title to skip the changelog check