Add Metric Reader and use IEnumerable for Metric collect instead of Batch#2306
Merged
cijothomas merged 6 commits intoSep 3, 2021
Merged
Conversation
cijothomas
commented
Sep 2, 2021
CodeBlanch
reviewed
Sep 3, 2021
| { | ||
| // Check if the Metric has valid | ||
| // entries and skip, if not. | ||
| yield return metrics[i]; |
Member
There was a problem hiding this comment.
I'm pretty sure yields always compile into an allocating structure.
Member
Author
There was a problem hiding this comment.
will come back to this.
alanwest
reviewed
Sep 3, 2021
| IEnumerable<string> meterSources, | ||
| List<MeterProviderBuilderSdk.InstrumentationFactory> instrumentationFactories, | ||
| MetricProcessor[] metricProcessors) | ||
| MetricProcessor[] metricProcessors, |
Member
There was a problem hiding this comment.
Looks like MetricProcessor is not used anymore. Is the plan to remove in a follow up?
Member
Author
There was a problem hiding this comment.
yes a lot of cleanup coming..
alanwest
approved these changes
Sep 3, 2021
reyang
reviewed
Sep 3, 2021
reyang
reviewed
Sep 3, 2021
reyang
reviewed
Sep 3, 2021
| this.exporter.Export(metrics); | ||
| } | ||
|
|
||
| public override AggregationTemporality GetAggregationTemporality() |
Member
There was a problem hiding this comment.
Do we want this to be a method or a get property?
reyang
reviewed
Sep 3, 2021
reyang
reviewed
Sep 3, 2021
reyang
reviewed
Sep 3, 2021
reyang
approved these changes
Sep 3, 2021
Merged
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.
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)