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

Metric console exporter modified to deal with all known types #2087

Merged

Conversation

cijothomas
Copy link
Member

Modifying ConsoleMetricExporter to explore and demo how an actual Exporter would look like.
(will modify both inmemory and console exporters existing today to support metrics as well, once the exporter interfaces are ready)

@cijothomas cijothomas requested a review from a team June 16, 2021 17:22
string valueDisplay = string.Empty;
if (metric is ISumMetric sumMetric)
{
if (sumMetric.Sum is double doubleSum)
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 need these if-else conditions or we simply call ToString for whatever point types?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to demonstrate that the sum is available as double, if the exporter's backend wants it as double.
(yes in this console, i could just ToString() it.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger that.

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor suggestions.

@codecov
Copy link

codecov bot commented Jun 16, 2021

Codecov Report

❗ No coverage uploaded for pull request base (metrics@9071827). Click here to learn what that means.
The diff coverage is 74.49%.

❗ Current head d3a8c9a differs from pull request most recent head 5aee114. Consider uploading reports for the commit 5aee114 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             metrics    #2087   +/-   ##
==========================================
  Coverage           ?   82.45%           
==========================================
  Files              ?      214           
  Lines              ?     6790           
  Branches           ?        0           
==========================================
  Hits               ?     5599           
  Misses             ?     1191           
  Partials           ?        0           
Impacted Files Coverage Δ
...metry.Api/Context/Propagation/BaggagePropagator.cs 83.92% <ø> (ø)
....Exporter.Jaeger/JaegerExporterHelperExtensions.cs 11.11% <0.00%> (ø)
....Exporter.Zipkin/ZipkinExporterHelperExtensions.cs 11.11% <0.00%> (ø)
...rc/OpenTelemetry/Metrics/DataPoint/DataPoint{T}.cs 0.00% <0.00%> (ø)
src/OpenTelemetry/Metrics/DataPoint/Exemplar.cs 0.00% <0.00%> (ø)
src/OpenTelemetry/Metrics/DataPoint/Exemplar{T}.cs 0.00% <0.00%> (ø)
...trics/MetricAggregators/SummaryMetricAggregator.cs 0.00% <0.00%> (ø)
src/OpenTelemetry/ProviderExtensions.cs 50.00% <0.00%> (ø)
src/OpenTelemetry/Trace/SamplingParameters.cs 76.92% <ø> (ø)
...s.Hosting/Trace/TracerProviderBuilderExtensions.cs 17.64% <17.64%> (ø)
... and 64 more

Copy link
Member

@alanwest alanwest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cijothomas cijothomas merged commit 8492de6 into open-telemetry:metrics Jun 16, 2021
@cijothomas cijothomas deleted the cijothomas/consolemetric1 branch June 16, 2021 18:20
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