Skip to content

Commit

Permalink
Resource as a parameter if included in the batch of metric points
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Aug 3, 2023
1 parent 77fd764 commit b865f8e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -1135,12 +1135,6 @@ SDK](../overview.md#sdk) authors MAY choose to add parameters (e.g. callback,
filter, timeout). [OpenTelemetry SDK](../overview.md#sdk) authors MAY choose the
return value type, or do not return anything.

`Collect` SHOULD invoke [Produce](#produce-batch) on registered
[MetricProducers](#metricproducer). If the bastch of metric points from
`Produce` includes [Resource](../resource/sdk.md) information, `Collect` SHOULD
ignore `Resource` from `Produce`, and use the `Resource` provided when
constructing the MeterProvider instead.

Note: it is expected that the `MetricReader.Collect` implementations will be
provided by the SDK, so it is RECOMMENDED to prevent the user from accidentally
overriding it, if possible (e.g. `final` in C++ and Java, `sealed` in C#).
Expand Down Expand Up @@ -1434,7 +1428,9 @@ A `MetricProducer` MUST support the following functions:

`Produce` provides metrics from the MetricProducer to the caller. `Produce`
MUST return a batch of [Metric points](./data-model.md#metric-points).
`Produce` does not have any required parameters, however, [OpenTelemetry
If the batch of [Metric points](./data-model.md#metric-points) includes
resource information, `Produce` SHOULD require a resource as a parameter.
`Produce` does not have any other required parameters, however, [OpenTelemetry
SDK](../overview.md#sdk) authors MAY choose to add required or optional
parameters (e.g. timeout).

Expand Down

0 comments on commit b865f8e

Please sign in to comment.