Skip to content

Commit

Permalink
Clarify metrics export concurrency (#4206)
Browse files Browse the repository at this point in the history
Same as
#4173
for metrics SDK.

Towards
#4134
  • Loading branch information
pellared authored Sep 13, 2024
1 parent 7a5ff20 commit 384b9c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ release.

### Metrics

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

### Logs

- Clarify that log record mutations are visible in next registered processors.
Expand Down
7 changes: 5 additions & 2 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,9 @@ Configurable parameters:
* `exportTimeoutMillis` - how long the export can run before it is cancelled.
The default value is 30000 (milliseconds).

The reader MUST synchronize calls to `MetricExporter`'s `Export`
to make sure that they are not invoked concurrently.

One possible implementation of periodic exporting MetricReader is to inherit
from `MetricReader` and start a background task which calls the inherited
`Collect()` method at the requested `exportIntervalMillis`. The reader's
Expand Down Expand Up @@ -1485,8 +1488,8 @@ and transmit the data to the destination.
The SDK MUST provide a way for the exporter to get the [Meter](./api.md#meter)
information (e.g. name, version, etc.) associated with each `Metric Point`.

`Export` will never be called concurrently for the same exporter instance.
`Export` can be called again only after the current call returns.
`Export` should never be called concurrently with other `Export` calls for the
same exporter instance.

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

0 comments on commit 384b9c1

Please sign in to comment.