Skip to content

Commit 384b9c1

Browse files
authored
Clarify metrics export concurrency (#4206)
Same as #4173 for metrics SDK. Towards #4134
1 parent 7a5ff20 commit 384b9c1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ release.
1919

2020
### Metrics
2121

22+
- Clarify that `Export` MUST NOT be called by periodic exporting MetricReader concurrently.
23+
([#4206](https://github.com/open-telemetry/opentelemetry-specification/pull/4206))
24+
2225
### Logs
2326

2427
- Clarify that log record mutations are visible in next registered processors.

specification/metrics/sdk.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,9 @@ Configurable parameters:
13751375
* `exportTimeoutMillis` - how long the export can run before it is cancelled.
13761376
The default value is 30000 (milliseconds).
13771377

1378+
The reader MUST synchronize calls to `MetricExporter`'s `Export`
1379+
to make sure that they are not invoked concurrently.
1380+
13781381
One possible implementation of periodic exporting MetricReader is to inherit
13791382
from `MetricReader` and start a background task which calls the inherited
13801383
`Collect()` method at the requested `exportIntervalMillis`. The reader's
@@ -1485,8 +1488,8 @@ and transmit the data to the destination.
14851488
The SDK MUST provide a way for the exporter to get the [Meter](./api.md#meter)
14861489
information (e.g. name, version, etc.) associated with each `Metric Point`.
14871490

1488-
`Export` will never be called concurrently for the same exporter instance.
1489-
`Export` can be called again only after the current call returns.
1491+
`Export` should never be called concurrently with other `Export` calls for the
1492+
same exporter instance.
14901493

14911494
`Export` MUST NOT block indefinitely, there MUST be a reasonable upper limit
14921495
after which the call must time out with an error result (Failure).

0 commit comments

Comments
 (0)