Skip to content
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

Merged

Conversation

cijothomas
Copy link
Member

  1. 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.

  2. Replace Batch with plan IEnumerable as per discussion in Refactor aggregator and exporters #2295 (comment)

  3. 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)

  4. Addressed this comment: Refactor MeterProvider to be similar to TracerProvider #2141 (comment)

@cijothomas cijothomas requested a review from a team September 2, 2021 22:37
{
// Check if the Metric has valid
// entries and skip, if not.
yield return metrics[i];
Copy link
Member

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.

Copy link
Member Author

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,
Copy link
Member

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?

Copy link
Member Author

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()
Copy link
Member

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?

@cijothomas cijothomas merged commit 1e6a324 into open-telemetry:metrics Sep 3, 2021
@cijothomas cijothomas deleted the cijothomas/metricreader branch September 3, 2021 03:32
@cijothomas cijothomas mentioned this pull request Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants