Skip to content

Fix metric export interval to match spec#2641

Merged
cijothomas merged 5 commits into
open-telemetry:mainfrom
svetlanabrennan:svetlanabrennan/change-metric-export-interval
Nov 19, 2021
Merged

Fix metric export interval to match spec#2641
cijothomas merged 5 commits into
open-telemetry:mainfrom
svetlanabrennan:svetlanabrennan/change-metric-export-interval

Conversation

@svetlanabrennan

@svetlanabrennan svetlanabrennan commented Nov 19, 2021

Copy link
Copy Markdown
Contributor

The spec says export interval should be 60000 milliseconds and this pr fixes this for the otlp metric exporter.

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Design discussion issue #
  • Changes in public API reviewed

@svetlanabrennan svetlanabrennan requested a review from a team November 19, 2021 00:06
@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 19, 2021

Copy link
Copy Markdown

CLA Signed

The committers are authorized under a signed CLA.

/// Gets or sets the metric export interval in milliseconds. The default value is 60000.
/// </summary>
public int MetricExportIntervalMilliseconds { get; set; } = Timeout.Infinite;
public int MetricExportIntervalMilliseconds { get; set; } = 60000;

@reyang reyang Nov 19, 2021

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.

Why would a console exporter use the periodic exporting strategy by default?

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.

Ah, yes that makes sense now. The side-effect of this change causing the console exporter to default to periodic exporting was not immediately obvious.

var reader = options.MetricExportIntervalMilliseconds == Timeout.Infinite
? new BaseExportingMetricReader(exporter)
: new PeriodicExportingMetricReader(exporter, options.MetricExportIntervalMilliseconds);

My gut says it would make sense to decouple the idea of periodic vs. non-periodic in a separate config setting. Kinda similar to how tracing has the batch exporter options.

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.

Maybe break this into two PRs... because I think the change to the OTLP exporter is correct.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok. I broke it up.

@codecov

codecov Bot commented Nov 19, 2021

Copy link
Copy Markdown

Codecov Report

Merging #2641 (9924dd3) into main (66d2621) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

❗ Current head 9924dd3 differs from pull request most recent head 508a0fd. Consider uploading reports for the commit 508a0fd to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2641      +/-   ##
==========================================
- Coverage   80.97%   80.92%   -0.05%     
==========================================
  Files         243      243              
  Lines        8547     8547              
==========================================
- Hits         6921     6917       -4     
- Misses       1626     1630       +4     
Impacted Files Coverage Δ
...orter.OpenTelemetryProtocol/OtlpExporterOptions.cs 100.00% <100.00%> (ø)
...ZPages/Implementation/ZPagesExporterEventSource.cs 56.25% <0.00%> (-6.25%) ⬇️
...ter.ZPages/Implementation/ZPagesActivityTracker.cs 97.14% <0.00%> (-2.86%) ⬇️
...nTelemetry/Internal/OpenTelemetrySdkEventSource.cs 73.33% <0.00%> (-0.96%) ⬇️
...Telemetry/Internal/SelfDiagnosticsEventListener.cs 96.87% <0.00%> (-0.79%) ⬇️

@svetlanabrennan svetlanabrennan force-pushed the svetlanabrennan/change-metric-export-interval branch from 50fc91c to 74c02cb Compare November 19, 2021 01:10

@reyang reyang left a comment

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.

LGTM.

@cijothomas

Copy link
Copy Markdown
Member

@svetlanabrennan Could you update the description as it is outdated now? The linked issue require separate handling, so that may be removed.

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