Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify metrics export concurrency #4206

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`
pellared marked this conversation as resolved.
Show resolved Hide resolved
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
Loading