Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all 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
6 changes: 6 additions & 0 deletions src/Aspire.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

#if DEBUG
using OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
#endif

using RootCommand = Aspire.Cli.Commands.RootCommand;

namespace Aspire.Cli;
Expand All @@ -32,6 +36,7 @@ private static IHost BuildApplication(string[] args)
logging.IncludeScopes = true;
});

#if DEBUG
var otelBuilder = builder.Services
.AddOpenTelemetry()
.WithTracing(tracing => {
Expand All @@ -56,6 +61,7 @@ private static IHost BuildApplication(string[] args)
// has to finish sending telemetry.
otelBuilder.UseOtlpExporter();
}
#endif

var debugMode = args?.Any(a => a == "--debug" || a == "-d") ?? false;

Expand Down
Loading