Skip to content

Commit

Permalink
Add back aspnetcore instrumentation in example (#3021)
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas authored Mar 11, 2022
1 parent d55de34 commit 5f509bf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/AspNetCore/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
builder.Services.AddOpenTelemetryMetrics(options =>
{
options.SetResourceBuilder(resourceBuilder)
.AddHttpClientInstrumentation();
.AddHttpClientInstrumentation()
.AddAspNetCoreInstrumentation();

var metricsExporter = builder.Configuration.GetValue<string>("UseMetricsExporter").ToLowerInvariant();
switch (metricsExporter)
Expand All @@ -132,8 +133,6 @@
default:
options.AddConsoleExporter((exporterOptions, metricReaderOptions) =>
{
exporterOptions.Targets = ConsoleExporterOutputTargets.Console;

// The ConsoleMetricExporter defaults to a manual collect cycle.
// This configuration causes metrics to be exported to stdout on a 10s interval.
metricReaderOptions.MetricReaderType = MetricReaderType.Periodic;
Expand Down

0 comments on commit 5f509bf

Please sign in to comment.