Modify metric example to use console exporter defaults (#3143)

This commit is contained in:
Cijo Thomas 2022-04-06 07:49:25 -07:00 committed by GitHub
parent 950c6162b4
commit 4e2437cfcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 10 deletions

View File

@ -90,10 +90,6 @@ namespace Examples.AspNet
meterBuilder.AddConsoleExporter((exporterOptions, metricReaderOptions) => meterBuilder.AddConsoleExporter((exporterOptions, metricReaderOptions) =>
{ {
exporterOptions.Targets = ConsoleExporterOutputTargets.Debug; exporterOptions.Targets = ConsoleExporterOutputTargets.Debug;
// The ConsoleMetricExporter defaults to a manual collect cycle.
// This configuration causes metrics to be exported to stdout on a 10s interval.
metricReaderOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 10000;
}); });
break; break;
} }

View File

@ -131,12 +131,7 @@ builder.Services.AddOpenTelemetryMetrics(options =>
}); });
break; break;
default: default:
options.AddConsoleExporter((exporterOptions, metricReaderOptions) => options.AddConsoleExporter();
{
// The ConsoleMetricExporter defaults to a manual collect cycle.
// This configuration causes metrics to be exported to stdout on a 10s interval.
metricReaderOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 10000;
});
break; break;
} }
}); });