feat(sdk-metrics): align MetricReader with specification and other language implementations#3225
Merged
dyladan merged 13 commits intoopen-telemetry:mainfrom Sep 12, 2022
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3225 +/- ##
=======================================
Coverage 93.30% 93.30%
=======================================
Files 202 203 +1
Lines 6599 6606 +7
Branches 1384 1389 +5
=======================================
+ Hits 6157 6164 +7
Misses 442 442
|
…or with spec/other common implementations.
a6f863f to
05aa7e9
Compare
legendecas
reviewed
Sep 5, 2022
Member
legendecas
left a comment
There was a problem hiding this comment.
I think this can be a good approach to reduce the duplication on the aggregation selections.
| constructor(options: PeriodicExportingMetricReaderOptions) { | ||
| super(); | ||
| super({ | ||
| aggregationSelector: options.exporter.selectAggregation, |
Member
There was a problem hiding this comment.
options.exporter.selectAggregation should either have their receiver to be bound to options.exporter, or maybe we should make the selector an interface, with methods like selectAggregation and selectAggregationTemporality, so that we can safely pass the selector around.
interface AggregationSelector {
selectAggregation(instrumentType): Aggregation;
selectTemporality(instrumentType): AggregationTemporality;
}
Member
Author
There was a problem hiding this comment.
Good catch, thanks! 🙂
I changed it to bind to the exporter in 2453614. 🙂
legendecas
approved these changes
Sep 8, 2022
Member
legendecas
left a comment
There was a problem hiding this comment.
LGTM. Thank you for working on this <3
experimental/packages/opentelemetry-sdk-metrics/test/export/utils.ts
Outdated
Show resolved
Hide resolved
vmarchaud
approved these changes
Sep 10, 2022
dyladan
approved these changes
Sep 12, 2022
This was referenced Sep 12, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
The spec states that:
For the
PeriodicExportingMetricReaderthe spec states configurable parameters as:This PR:
MetricReaderwith the spec by adding configurability ofaggregationTemporalitySelectorandaggregationSelectorMetricReaderinterfacePeriodicExportingMetricReader'sAggregationSelectorPeriodicExportingMetricReader'saggregationSelectorvia the ExporterselectAggregationTemporalityoptional forPushMetricExportersPeriodicExportingMetricReaderwill fall back to cumulative if not specified.As the spec does not seem entirely clear, I added some links above with references to other language SDKs' implementations. 🙂
Fixes #3213
Related #3060
Short description of the changes
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist: