Update extending-the-sdk Readme to call out that the exporter can not make any assumptions about the Metric batch (#3071)

This commit is contained in:
Timothy Mothra 2022-03-31 12:14:24 -07:00 committed by GitHub
parent 213fc03553
commit 25ba21375f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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.