From 25ba21375f0f8f66c0960fe0baf4bb86d8822fdb Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Thu, 31 Mar 2022 12:14:24 -0700 Subject: [PATCH] Update extending-the-sdk Readme to call out that the exporter can not make any assumptions about the Metric batch (#3071) --- docs/metrics/extending-the-sdk/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/metrics/extending-the-sdk/README.md b/docs/metrics/extending-the-sdk/README.md index 999e3e57e13..b3533fe1969 100644 --- a/docs/metrics/extending-the-sdk/README.md +++ b/docs/metrics/extending-the-sdk/README.md @@ -29,6 +29,10 @@ not covered by the built-in exporters: done via `OpenTelemetry.SuppressInstrumentationScope`. * Exporters receives a batch of `Metric`, and each `Metric` can contain 1 or more `MetricPoint`s. + The exporter should perform all actions (e.g. serializing etc.) with + the `Metric`s and `MetricsPoint`s in the batch before returning control from + `Export`, once the control is returned, the exporter can no longer make any + assumptions about the state of the batch or anything inside it. * Exporters should use `ParentProvider.GetResource()` to get the `Resource` associated with the provider.