diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Extensions/IDistributedApplicationBuilderExtensions.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Extensions/IDistributedApplicationBuilderExtensions.cs deleted file mode 100644 index 1a031f3b41..0000000000 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Extensions/IDistributedApplicationBuilderExtensions.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System.Linq; -using System.Threading.Tasks; -using Aspire.Hosting.ApplicationModel; - -namespace Aspire.Hosting; - -public static class IDistributedApplicationBuilderExtensions -{ - /// - /// https://github.com/davidfowl/aspire-ai-chat-demo/blob/main/AIChat.AppHost/DashboardExtensions.cs - /// - public static void AddAspireDashboard(this IDistributedApplicationBuilder builder) - { - if (builder.ExecutionContext.IsPublishMode) - { - // The name aspire-dashboard is special cased and excluded from the default - var dashboard = builder.AddContainer("dashboard", "mcr.microsoft.com/dotnet/aspire-dashboard:9.4") - .WithHttpEndpoint(targetPort: 18888) - .WithHttpEndpoint(name: "otlp", targetPort: 18889); - - builder.Eventing.Subscribe((e, ct) => - { - // We loop over all resources and set the OTLP endpoint to the dashboard - // we should make WithOtlpExporter() add an annotation so we can detect this - // automatically in the future. - foreach (var r in e.Model.Resources.OfType()) - { - if (r == dashboard.Resource) - { - continue; - } - - builder.CreateResourceBuilder(r).WithEnvironment(c => - { - c.EnvironmentVariables["OTEL_EXPORTER_OTLP_ENDPOINT"] = dashboard.GetEndpoint("otlp"); - c.EnvironmentVariables["OTEL_EXPORTER_OTLP_PROTOCOL"] = "grpc"; - c.EnvironmentVariables["OTEL_SERVICE_NAME"] = r.Name; - }); - } - - return Task.CompletedTask; - }); - } - } -} diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs index 72ba46779f..ad6940a6f1 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs @@ -116,8 +116,6 @@ .WithExplicitStart(); } -builder.AddAspireDashboard(); - await builder .Build() .RunAsync();