-
Notifications
You must be signed in to change notification settings - Fork 773
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
Add Metric Reader and use IEnumerable for Metric collect instead of Batch #2306
Add Metric Reader and use IEnumerable for Metric collect instead of Batch #2306
Conversation
{ | ||
// Check if the Metric has valid | ||
// entries and skip, if not. | ||
yield return metrics[i]; |
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'm pretty sure yields always compile into an allocating structure.
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.
will come back to this.
private int metricIndex = -1; | ||
|
||
internal MeterProviderSdk( | ||
Resource resource, | ||
IEnumerable<string> meterSources, | ||
List<MeterProviderBuilderSdk.InstrumentationFactory> instrumentationFactories, | ||
MetricProcessor[] metricProcessors) | ||
MetricProcessor[] metricProcessors, |
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.
Looks like MetricProcessor is not used anymore. Is the plan to remove in a follow up?
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.
yes a lot of cleanup coming..
this.exporter.Export(metrics); | ||
} | ||
|
||
public override AggregationTemporality GetAggregationTemporality() |
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.
Do we want this to be a method or a get property?
Trying the to-be-merged spec for MetricReader : https://github.com/open-telemetry/opentelemetry-specification/pull/1888/files
Note that we don't support multiple MetricReaders currently, this will be added in follow ups.
Replace Batch with plan IEnumerable as per discussion in Refactor aggregator and exporters #2295 (comment)
Modified Console/Prometheus (To demonstrate one push and one pull based). Rest of the Exporters, and clean up of existing MetricProcessor,Push/PullProcessor will be follow up PR to avoid making this PR even bigger. (Same for proper implementation/lack of it for Flush/Shutdown etc)
Addressed this comment: Refactor MeterProvider to be similar to TracerProvider #2141 (comment)