diff --git a/src/HelloShop.AppHost/HelloShop.AppHost.csproj b/src/HelloShop.AppHost/HelloShop.AppHost.csproj
index cbb7c49..960fddb 100644
--- a/src/HelloShop.AppHost/HelloShop.AppHost.csproj
+++ b/src/HelloShop.AppHost/HelloShop.AppHost.csproj
@@ -1,20 +1,20 @@
-
- Exe
- net9.0
- enable
- enable
- true
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Exe
+ net9.0
+ enable
+ enable
+ true
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/HelloShop.BasketService/HelloShop.BasketService.csproj b/src/HelloShop.BasketService/HelloShop.BasketService.csproj
index 36218ec..f7efd5f 100644
--- a/src/HelloShop.BasketService/HelloShop.BasketService.csproj
+++ b/src/HelloShop.BasketService/HelloShop.BasketService.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/src/HelloShop.IdentityService/HelloShop.IdentityService.csproj b/src/HelloShop.IdentityService/HelloShop.IdentityService.csproj
index 92492e8..96312b2 100644
--- a/src/HelloShop.IdentityService/HelloShop.IdentityService.csproj
+++ b/src/HelloShop.IdentityService/HelloShop.IdentityService.csproj
@@ -5,13 +5,13 @@
enable
-
-
-
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
diff --git a/src/HelloShop.ProductService/HelloShop.ProductService.csproj b/src/HelloShop.ProductService/HelloShop.ProductService.csproj
index 6617dda..45f5f5a 100644
--- a/src/HelloShop.ProductService/HelloShop.ProductService.csproj
+++ b/src/HelloShop.ProductService/HelloShop.ProductService.csproj
@@ -5,11 +5,11 @@
enable
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
diff --git a/src/HelloShop.ServiceDefaults/Extensions.cs b/src/HelloShop.ServiceDefaults/Extensions.cs
index c59308d..390733f 100644
--- a/src/HelloShop.ServiceDefaults/Extensions.cs
+++ b/src/HelloShop.ServiceDefaults/Extensions.cs
@@ -42,8 +42,9 @@ public static class Extensions
builder.Services.AddOpenTelemetry()
.WithMetrics(metrics =>
{
- metrics.AddRuntimeInstrumentation()
- .AddBuiltInMeters();
+ metrics.AddAspNetCoreInstrumentation()
+ .AddHttpClientInstrumentation()
+ .AddRuntimeInstrumentation();
})
.WithTracing(tracing =>
{
@@ -54,8 +55,9 @@ public static class Extensions
}
tracing.AddAspNetCoreInstrumentation()
- .AddGrpcClientInstrumentation()
- .AddHttpClientInstrumentation();
+ // Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package)
+ //.AddGrpcClientInstrumentation()
+ .AddHttpClientInstrumentation();
});
builder.AddOpenTelemetryExporters();
@@ -78,9 +80,12 @@ public static class Extensions
// builder.Services.AddOpenTelemetry()
// .WithMetrics(metrics => metrics.AddPrometheusExporter());
- // Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.Exporter package)
- // builder.Services.AddOpenTelemetry()
- // .UseAzureMonitor();
+ // Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.AspNetCore package)
+ //if (!string.IsNullOrEmpty(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"]))
+ //{
+ // builder.Services.AddOpenTelemetry()
+ // .UseAzureMonitor();
+ //}
return builder;
}
@@ -99,21 +104,20 @@ public static class Extensions
// Uncomment the following line to enable the Prometheus endpoint (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package)
// app.MapPrometheusScrapingEndpoint();
- // All health checks must pass for app to be considered ready to accept traffic after starting
- app.MapHealthChecks("/health");
-
- // Only health checks tagged with the "live" tag must pass for app to be considered alive
- app.MapHealthChecks("/alive", new HealthCheckOptions
+ // Adding health checks endpoints to applications in non-development environments has security implications.
+ // See https://aka.ms/dotnet/aspire/healthchecks for details before enabling these endpoints in non-development environments.
+ if (app.Environment.IsDevelopment())
{
- Predicate = r => r.Tags.Contains("live")
- });
+ // All health checks must pass for app to be considered ready to accept traffic after starting
+ app.MapHealthChecks("/health");
+
+ // Only health checks tagged with the "live" tag must pass for app to be considered alive
+ app.MapHealthChecks("/alive", new HealthCheckOptions
+ {
+ Predicate = r => r.Tags.Contains("live")
+ });
+ }
return app;
}
-
- private static MeterProviderBuilder AddBuiltInMeters(this MeterProviderBuilder meterProviderBuilder) =>
- meterProviderBuilder.AddMeter(
- "Microsoft.AspNetCore.Hosting",
- "Microsoft.AspNetCore.Server.Kestrel",
- "System.Net.Http");
}
diff --git a/src/HelloShop.ServiceDefaults/HelloShop.ServiceDefaults.csproj b/src/HelloShop.ServiceDefaults/HelloShop.ServiceDefaults.csproj
index 5151dfc..bf5a6c3 100644
--- a/src/HelloShop.ServiceDefaults/HelloShop.ServiceDefaults.csproj
+++ b/src/HelloShop.ServiceDefaults/HelloShop.ServiceDefaults.csproj
@@ -1,6 +1,5 @@
- Library
net9.0
enable
enable
@@ -10,14 +9,13 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/HelloShop.ProductService.FunctionalTests/HelloShop.ProductService.FunctionalTests.csproj b/tests/HelloShop.ProductService.FunctionalTests/HelloShop.ProductService.FunctionalTests.csproj
index cc6669e..430f7ed 100644
--- a/tests/HelloShop.ProductService.FunctionalTests/HelloShop.ProductService.FunctionalTests.csproj
+++ b/tests/HelloShop.ProductService.FunctionalTests/HelloShop.ProductService.FunctionalTests.csproj
@@ -7,13 +7,13 @@
true
-
-
-
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/tests/HelloShop.ProductService.UnitTests/HelloShop.ProductService.UnitTests.csproj b/tests/HelloShop.ProductService.UnitTests/HelloShop.ProductService.UnitTests.csproj
index cc6669e..430f7ed 100644
--- a/tests/HelloShop.ProductService.UnitTests/HelloShop.ProductService.UnitTests.csproj
+++ b/tests/HelloShop.ProductService.UnitTests/HelloShop.ProductService.UnitTests.csproj
@@ -7,13 +7,13 @@
true
-
-
-
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all