-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Verify compliant metric SDK specification implementation: MetricReader/MetricReader operations/Collect #3662
Comments
I would like to take this. |
opentelemetry-go/sdk/metric/reader.go Lines 60 to 65 in cbc5890
opentelemetry-go/sdk/metric/reader.go Lines 73 to 79 in cbc5890
opentelemetry-go/sdk/metric/reader.go Lines 81 to 103 in cbc5890
|
This option is ONLY exposed on periodic readers.
This option is only provided on ManualReaders: opentelemetry-go/sdk/metric/manual_reader.go Lines 222 to 226 in cbc5890
For PeriodicReaders, the MetricExporter provides the default output aggregation.
This option is only provided for ManualReaders: opentelemetry-go/sdk/metric/manual_reader.go Lines 205 to 210 in cbc5890
For PeriodicReaders, the MetricExporter provides the default output temporality.
This option is not provided when constructing a MetricReader. |
We provide a PeriodicReader:
|
The periodic reader defaults to the exporter's temporality: opentelemetry-go/sdk/metric/periodic_reader.go Lines 213 to 215 in cbc5890
The manual reader defaults to the configured temporality: opentelemetry-go/sdk/metric/manual_reader.go Lines 84 to 87 in cbc5890
The collection + aggregation pipeline uses the temporality of the reader: opentelemetry-go/sdk/metric/pipeline.go Lines 328 to 329 in cbc5890
That temporality is used to ensure that the aggregation is output in the correct temporality: opentelemetry-go/sdk/metric/internal/aggregate/aggregate.go Lines 92 to 96 in cbc5890
I believe that satisfies the "MUST ensure that data points ... are output in the configured aggregation temporality", even though much of the implementation details are not implemented within our Readers. |
Multiple readers can be registered on a single MeterProvider (readers are appended to a list): opentelemetry-go/sdk/metric/config.go Lines 120 to 130 in cbc5890
Each reader results in an independent pipeline: opentelemetry-go/sdk/metric/pipeline.go Lines 481 to 488 in cbc5890
Invoking Collect on a reader only calls produce on its own pipeline. Periodic:
and Manual: opentelemetry-go/sdk/metric/manual_reader.go Line 148 in cbc5890
produce only invokes callbacks and computes aggregations from the pipeline's own, independent callbacks and aggregations: opentelemetry-go/sdk/metric/pipeline.go Lines 123 to 179 in cbc5890
|
We return this error when a reader is registered more than once (e.g. with different MeterProviders): opentelemetry-go/sdk/metric/reader.go Line 27 in cbc5890
Periodic Reader impl: opentelemetry-go/sdk/metric/periodic_reader.go Lines 188 to 195 in cbc5890
Manual Reader impl: opentelemetry-go/sdk/metric/manual_reader.go Lines 57 to 65 in cbc5890
|
The ForceFlush and Shutdown signals of readers are aggregated when the MeterProvider is created: opentelemetry-go/sdk/metric/config.go Lines 32 to 43 in cbc5890
opentelemetry-go/sdk/metric/provider.go Lines 51 to 58 in cbc5890
And then are invoked when ForceFlush and Shutdown are invoked on the MeterProvider: opentelemetry-go/sdk/metric/provider.go Lines 114 to 118 in cbc5890
opentelemetry-go/sdk/metric/provider.go Lines 137 to 151 in cbc5890
|
MetricReader Operations:
opentelemetry-go/sdk/metric/manual_reader.go Line 129 in cbc5890
From SDK: opentelemetry-go/sdk/metric/manual_reader.go Line 148 in cbc5890
From Producers: opentelemetry-go/sdk/metric/manual_reader.go Lines 153 to 159 in cbc5890
opentelemetry-go/sdk/metric/periodic_reader.go Lines 278 to 284 in cbc5890
Collect returns an error. See signature above.
We support partial results by aggregating errors and continuing on during callbacks that return errors: opentelemetry-go/sdk/metric/pipeline.go Lines 130 to 132 in cbc5890
opentelemetry-go/sdk/metric/pipeline.go Lines 142 to 144 in cbc5890
|
opentelemetry-go/sdk/metric/reader.go Lines 91 to 103 in cbc5890
In Shutdown(), readers store a shutdownProducer in the produer, which returns an error that is returned to the caller of Collect: opentelemetry-go/sdk/metric/manual_reader.go Lines 107 to 110 in cbc5890
opentelemetry-go/sdk/metric/periodic_reader.go Lines 330 to 333 in cbc5890
Shutdown returns an error.
Shutdown does not impose a timeout on collection or exporting of telemetry in the periodic reader It does accept a context, which allows users to easily place a timeout on collection or export. |
That is all for the MetricReader, MetricReader operations, Collect, and Shutdown sections. The bolded text above are contentious, or are areas where we differ from the specification. Our only differences occur in SHOULD sections. |
I think I misread the intention of this issue... If this is only about verifying collect, see #3662 (comment) I did not find any issues regarding the Collect function.. |
The targeted material has all been identified and checked to be compliant. Closing. |
The text was updated successfully, but these errors were encountered: