-
Notifications
You must be signed in to change notification settings - Fork 809
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
feat(sdk-metrics): align MetricReader with specification and other language implementations #3225
feat(sdk-metrics): align MetricReader with specification and other language implementations #3225
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks! 🙂
I changed it to bind to the exporter in 2453614. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for working on this <3
Which problem is this PR solving?
The spec states that:
For the
PeriodicExportingMetricReader
the spec states configurable parameters as:This PR:
MetricReader
with the spec by adding configurability ofaggregationTemporalitySelector
andaggregationSelector
MetricReader
interfacePeriodicExportingMetricReader
'sAggregationSelector
PeriodicExportingMetricReader
'saggregationSelector
via the ExporterselectAggregationTemporality
optional forPushMetricExporter
sPeriodicExportingMetricReader
will 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: