Skip to content

Add Metric Reader and use IEnumerable for Metric collect instead of Batch#2306

Merged
cijothomas merged 6 commits into
open-telemetry:metricsfrom
cijothomas:cijothomas/metricreader
Sep 3, 2021
Merged

Add Metric Reader and use IEnumerable for Metric collect instead of Batch#2306
cijothomas merged 6 commits into
open-telemetry:metricsfrom
cijothomas:cijothomas/metricreader

Conversation

@cijothomas

Copy link
Copy Markdown
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
Comment thread src/OpenTelemetry/Batch.cs
{
// Check if the Metric has valid
// entries and skip, if not.
yield return metrics[i];

Copy link
Copy Markdown
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
Copy Markdown
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.

IEnumerable<string> meterSources,
List<MeterProviderBuilderSdk.InstrumentationFactory> instrumentationFactories,
MetricProcessor[] metricProcessors)
MetricProcessor[] metricProcessors,

Copy link
Copy Markdown
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
Copy Markdown
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..

Comment thread src/OpenTelemetry.Exporter.Console/ConsoleExporterOptions.cs
Comment thread src/OpenTelemetry/Metrics/BaseExportingMetricReader.cs
this.exporter.Export(metrics);
}

public override AggregationTemporality GetAggregationTemporality()

Copy link
Copy Markdown
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?

Comment thread src/OpenTelemetry/Metrics/MeterProviderSdk.cs
Comment thread src/OpenTelemetry/Metrics/MetricExporter.cs
Comment thread src/OpenTelemetry/Metrics/PeriodicExportingMetricReader.cs
@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