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

Fix metric export interval to match spec #2641

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/OpenTelemetry.Exporter.Console/ConsoleExporterOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// limitations under the License.
// </copyright>

using System.Threading;
using OpenTelemetry.Metrics;

namespace OpenTelemetry.Exporter
Expand All @@ -27,9 +26,9 @@ public class ConsoleExporterOptions
public ConsoleExporterOutputTargets Targets { get; set; } = ConsoleExporterOutputTargets.Console;

/// <summary>
/// Gets or sets the metric export interval in milliseconds. The default value is <c>Timeout.Infinite</c>.
/// 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;
Copy link
Member

@reyang reyang Nov 19, 2021

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


/// <summary>
/// Gets or sets the AggregationTemporality used for Histogram
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ public OtlpExporterOptions()
public BatchExportProcessorOptions<Activity> BatchExportProcessorOptions { get; set; } = new BatchExportActivityProcessorOptions();

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

/// <summary>
/// Gets or sets the AggregationTemporality used for Histogram
Expand Down