19 changed files with 354 additions and 9 deletions
@ -0,0 +1,92 @@ |
|||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|||
# Visual Studio Version 17 |
|||
VisualStudioVersion = 17.8.0.0 |
|||
MinimumVisualStudioVersion = 17.8.0.0 |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnAbp.AppHost", "aspire\AppHost\eShopOnAbp.AppHost.csproj", "{83E18AE5-35EF-4E3E-AB6F-C5A96F1FE7CF}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnAbp.ServiceDefaults", "aspire\ServiceDefaults\eShopOnAbp.ServiceDefaults.csproj", "{25F596CB-734B-4D22-BB9B-BF3FE4ED645C}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "apps", "apps", "{224361D2-3869-4F9A-A882-2554036A98AF}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "services", "services", "{0B9A1A27-E4AC-4228-AE7A-FC2CEBE2AD7B}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.PublicWeb", "apps\public-web\src\EShopOnAbp.PublicWeb\EShopOnAbp.PublicWeb.csproj", "{FD9ECE3E-487B-4961-BEE9-3C26F866EAB2}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.AdministrationService.HttpApi.Host", "services\administration\src\EShopOnAbp.AdministrationService.HttpApi.Host\EShopOnAbp.AdministrationService.HttpApi.Host.csproj", "{A630417B-1C25-4BAB-B1D3-22C627DF0008}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.IdentityService.HttpApi.Host", "services\identity\src\EShopOnAbp.IdentityService.HttpApi.Host\EShopOnAbp.IdentityService.HttpApi.Host.csproj", "{582CE0DB-2B91-4978-9AF8-B18C732D08B5}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.BasketService", "services\basket\src\EShopOnAbp.BasketService\EShopOnAbp.BasketService.csproj", "{C6516D98-035B-4742-B3C8-B031455546DE}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.CatalogService.HttpApi.Host", "services\catalog\src\EShopOnAbp.CatalogService.HttpApi.Host\EShopOnAbp.CatalogService.HttpApi.Host.csproj", "{E41F937A-0FE1-4E55-B449-CABF5D42A093}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.CmskitService.HttpApi.Host", "services\cmskit\src\EShopOnAbp.CmskitService.HttpApi.Host\EShopOnAbp.CmskitService.HttpApi.Host.csproj", "{C08FF8C8-354D-40EC-A80C-AFCE36A88DF9}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.OrderingService.HttpApi.Host", "services\ordering\src\EShopOnAbp.OrderingService.HttpApi.Host\EShopOnAbp.OrderingService.HttpApi.Host.csproj", "{89A65776-2367-4855-8956-53322C2BF70B}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.PaymentService.HttpApi.Host", "services\payment\src\EShopOnAbp.PaymentService.HttpApi.Host\EShopOnAbp.PaymentService.HttpApi.Host.csproj", "{2C55D527-4E09-4FD6-B4C6-7EFDD457358F}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|Any CPU = Debug|Any CPU |
|||
Release|Any CPU = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{83E18AE5-35EF-4E3E-AB6F-C5A96F1FE7CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{83E18AE5-35EF-4E3E-AB6F-C5A96F1FE7CF}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{83E18AE5-35EF-4E3E-AB6F-C5A96F1FE7CF}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{83E18AE5-35EF-4E3E-AB6F-C5A96F1FE7CF}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{25F596CB-734B-4D22-BB9B-BF3FE4ED645C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{25F596CB-734B-4D22-BB9B-BF3FE4ED645C}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{25F596CB-734B-4D22-BB9B-BF3FE4ED645C}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{25F596CB-734B-4D22-BB9B-BF3FE4ED645C}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{FD9ECE3E-487B-4961-BEE9-3C26F866EAB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{FD9ECE3E-487B-4961-BEE9-3C26F866EAB2}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{FD9ECE3E-487B-4961-BEE9-3C26F866EAB2}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{FD9ECE3E-487B-4961-BEE9-3C26F866EAB2}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{A630417B-1C25-4BAB-B1D3-22C627DF0008}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{A630417B-1C25-4BAB-B1D3-22C627DF0008}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{A630417B-1C25-4BAB-B1D3-22C627DF0008}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{A630417B-1C25-4BAB-B1D3-22C627DF0008}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{582CE0DB-2B91-4978-9AF8-B18C732D08B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{582CE0DB-2B91-4978-9AF8-B18C732D08B5}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{582CE0DB-2B91-4978-9AF8-B18C732D08B5}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{582CE0DB-2B91-4978-9AF8-B18C732D08B5}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{C6516D98-035B-4742-B3C8-B031455546DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{C6516D98-035B-4742-B3C8-B031455546DE}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{C6516D98-035B-4742-B3C8-B031455546DE}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{C6516D98-035B-4742-B3C8-B031455546DE}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{E41F937A-0FE1-4E55-B449-CABF5D42A093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{E41F937A-0FE1-4E55-B449-CABF5D42A093}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{E41F937A-0FE1-4E55-B449-CABF5D42A093}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{E41F937A-0FE1-4E55-B449-CABF5D42A093}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{C08FF8C8-354D-40EC-A80C-AFCE36A88DF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{C08FF8C8-354D-40EC-A80C-AFCE36A88DF9}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{C08FF8C8-354D-40EC-A80C-AFCE36A88DF9}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{C08FF8C8-354D-40EC-A80C-AFCE36A88DF9}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{89A65776-2367-4855-8956-53322C2BF70B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{89A65776-2367-4855-8956-53322C2BF70B}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{89A65776-2367-4855-8956-53322C2BF70B}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{89A65776-2367-4855-8956-53322C2BF70B}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{2C55D527-4E09-4FD6-B4C6-7EFDD457358F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{2C55D527-4E09-4FD6-B4C6-7EFDD457358F}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{2C55D527-4E09-4FD6-B4C6-7EFDD457358F}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{2C55D527-4E09-4FD6-B4C6-7EFDD457358F}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
GlobalSection(ExtensibilityGlobals) = postSolution |
|||
SolutionGuid = {9E214FFD-834E-4F69-ADAA-F97C7C74B243} |
|||
EndGlobalSection |
|||
GlobalSection(NestedProjects) = preSolution |
|||
{FD9ECE3E-487B-4961-BEE9-3C26F866EAB2} = {224361D2-3869-4F9A-A882-2554036A98AF} |
|||
{A630417B-1C25-4BAB-B1D3-22C627DF0008} = {0B9A1A27-E4AC-4228-AE7A-FC2CEBE2AD7B} |
|||
{582CE0DB-2B91-4978-9AF8-B18C732D08B5} = {0B9A1A27-E4AC-4228-AE7A-FC2CEBE2AD7B} |
|||
{C6516D98-035B-4742-B3C8-B031455546DE} = {0B9A1A27-E4AC-4228-AE7A-FC2CEBE2AD7B} |
|||
{E41F937A-0FE1-4E55-B449-CABF5D42A093} = {0B9A1A27-E4AC-4228-AE7A-FC2CEBE2AD7B} |
|||
{C08FF8C8-354D-40EC-A80C-AFCE36A88DF9} = {0B9A1A27-E4AC-4228-AE7A-FC2CEBE2AD7B} |
|||
{89A65776-2367-4855-8956-53322C2BF70B} = {0B9A1A27-E4AC-4228-AE7A-FC2CEBE2AD7B} |
|||
{2C55D527-4E09-4FD6-B4C6-7EFDD457358F} = {0B9A1A27-E4AC-4228-AE7A-FC2CEBE2AD7B} |
|||
EndGlobalSection |
|||
EndGlobal |
|||
@ -0,0 +1,14 @@ |
|||
var builder = DistributedApplication.CreateBuilder(args); |
|||
|
|||
var administrationService = |
|||
builder.AddProject<Projects.EShopOnAbp_AdministrationService_HttpApi_Host>("administrationService"); |
|||
var identityService = builder.AddProject<Projects.EShopOnAbp_IdentityService_HttpApi_Host>("identityService"); |
|||
var basketService = builder.AddProject<Projects.EShopOnAbp_BasketService>("basketService"); |
|||
var catalogService = builder.AddProject<Projects.EShopOnAbp_CatalogService_HttpApi_Host>("catalogService"); |
|||
var cmsKitService = builder.AddProject<Projects.EShopOnAbp_CmskitService_HttpApi_Host>("cmsKitService"); |
|||
var orderingService = builder.AddProject<Projects.EShopOnAbp_OrderingService_HttpApi_Host>("orderingService"); |
|||
var paymentService = builder.AddProject<Projects.EShopOnAbp_PaymentService_HttpApi_Host>("paymentService"); |
|||
|
|||
// var publicWebApp = builder.AddProject<Projects.EShopOnAbp_PublicWeb>("public-web");
|
|||
|
|||
builder.Build().Run(); |
|||
@ -0,0 +1,30 @@ |
|||
{ |
|||
"$schema": "https://json.schemastore.org/launchsettings.json", |
|||
"profiles": { |
|||
"https": { |
|||
"commandName": "Project", |
|||
"dotnetRunMessages": true, |
|||
"launchBrowser": true, |
|||
"applicationUrl": "https://localhost:17286;http://localhost:15011", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development", |
|||
"DOTNET_ENVIRONMENT": "Development", |
|||
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21296", |
|||
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22033" |
|||
} |
|||
}, |
|||
"http": { |
|||
"commandName": "Project", |
|||
"dotnetRunMessages": true, |
|||
"launchBrowser": true, |
|||
"applicationUrl": "http://localhost:15011", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development", |
|||
"DOTNET_ENVIRONMENT": "Development", |
|||
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19089", |
|||
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20048", |
|||
"ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"Logging": { |
|||
"LogLevel": { |
|||
"Default": "Information", |
|||
"Microsoft.AspNetCore": "Warning" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
{ |
|||
"Logging": { |
|||
"LogLevel": { |
|||
"Default": "Information", |
|||
"Microsoft.AspNetCore": "Warning", |
|||
"Aspire.Hosting.Dcp": "Warning" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFramework>net8.0</TargetFramework> |
|||
<ImplicitUsings>enable</ImplicitUsings> |
|||
<Nullable>enable</Nullable> |
|||
<IsAspireHost>true</IsAspireHost> |
|||
<UserSecretsId>40d1d3f9-6593-4f5a-9d74-ff6ea82eb14e</UserSecretsId> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Aspire.Hosting.AppHost" Version="8.0.0-preview.7.24251.11" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\apps\public-web\src\EShopOnAbp.PublicWeb\EShopOnAbp.PublicWeb.csproj" /> |
|||
<ProjectReference Include="..\..\services\administration\src\EShopOnAbp.AdministrationService.HttpApi.Host\EShopOnAbp.AdministrationService.HttpApi.Host.csproj" /> |
|||
<ProjectReference Include="..\..\services\basket\src\EShopOnAbp.BasketService\EShopOnAbp.BasketService.csproj" /> |
|||
<ProjectReference Include="..\..\services\catalog\src\EShopOnAbp.CatalogService.HttpApi.Host\EShopOnAbp.CatalogService.HttpApi.Host.csproj" /> |
|||
<ProjectReference Include="..\..\services\cmskit\src\EShopOnAbp.CmskitService.HttpApi.Host\EShopOnAbp.CmskitService.HttpApi.Host.csproj" /> |
|||
<ProjectReference Include="..\..\services\identity\src\EShopOnAbp.IdentityService.HttpApi.Host\EShopOnAbp.IdentityService.HttpApi.Host.csproj" /> |
|||
<ProjectReference Include="..\..\services\ordering\src\EShopOnAbp.OrderingService.HttpApi.Host\EShopOnAbp.OrderingService.HttpApi.Host.csproj" /> |
|||
<ProjectReference Include="..\..\services\payment\src\EShopOnAbp.PaymentService.HttpApi.Host\EShopOnAbp.PaymentService.HttpApi.Host.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,115 @@ |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.AspNetCore.Diagnostics.HealthChecks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Diagnostics.HealthChecks; |
|||
using Microsoft.Extensions.Logging; |
|||
using OpenTelemetry; |
|||
using OpenTelemetry.Metrics; |
|||
using OpenTelemetry.Trace; |
|||
|
|||
namespace Microsoft.Extensions.Hosting; |
|||
|
|||
public static class Extensions |
|||
{ |
|||
public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder) |
|||
{ |
|||
builder.ConfigureOpenTelemetry(); |
|||
|
|||
builder.AddDefaultHealthChecks(); |
|||
|
|||
builder.Services.AddServiceDiscovery(); |
|||
|
|||
builder.Services.ConfigureHttpClientDefaults(http => |
|||
{ |
|||
// Turn on resilience by default
|
|||
http.AddStandardResilienceHandler(); |
|||
|
|||
// Turn on service discovery by default
|
|||
http.AddServiceDiscovery(); |
|||
}); |
|||
|
|||
return builder; |
|||
} |
|||
|
|||
public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicationBuilder builder) |
|||
{ |
|||
builder.Logging.AddOpenTelemetry(logging => |
|||
{ |
|||
logging.IncludeFormattedMessage = true; |
|||
logging.IncludeScopes = true; |
|||
}); |
|||
|
|||
builder.Services.AddOpenTelemetry() |
|||
.WithMetrics(metrics => |
|||
{ |
|||
metrics.AddAspNetCoreInstrumentation() |
|||
.AddHttpClientInstrumentation() |
|||
.AddRuntimeInstrumentation(); |
|||
}) |
|||
.WithTracing(tracing => |
|||
{ |
|||
tracing.AddAspNetCoreInstrumentation() |
|||
// Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package)
|
|||
//.AddGrpcClientInstrumentation()
|
|||
.AddHttpClientInstrumentation(); |
|||
}); |
|||
|
|||
builder.AddOpenTelemetryExporters(); |
|||
|
|||
return builder; |
|||
} |
|||
|
|||
private static IHostApplicationBuilder AddOpenTelemetryExporters(this IHostApplicationBuilder builder) |
|||
{ |
|||
var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]); |
|||
|
|||
if (useOtlpExporter) |
|||
{ |
|||
builder.Services.AddOpenTelemetry().UseOtlpExporter(); |
|||
} |
|||
|
|||
// Uncomment the following lines to enable the Prometheus exporter (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package)
|
|||
// builder.Services.AddOpenTelemetry()
|
|||
// .WithMetrics(metrics => metrics.AddPrometheusExporter());
|
|||
|
|||
// 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; |
|||
} |
|||
|
|||
public static IHostApplicationBuilder AddDefaultHealthChecks(this IHostApplicationBuilder builder) |
|||
{ |
|||
builder.Services.AddHealthChecks() |
|||
// Add a default liveness check to ensure app is responsive
|
|||
.AddCheck("self", () => HealthCheckResult.Healthy(), ["live"]); |
|||
|
|||
return builder; |
|||
} |
|||
|
|||
public static WebApplication MapDefaultEndpoints(this WebApplication app) |
|||
{ |
|||
// 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()) |
|||
{ |
|||
// 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") |
|||
}); |
|||
|
|||
// Uncomment the following line to enable the Prometheus endpoint (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package)
|
|||
// app.MapPrometheusScrapingEndpoint();
|
|||
} |
|||
|
|||
return app; |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net8.0</TargetFramework> |
|||
<ImplicitUsings>enable</ImplicitUsings> |
|||
<Nullable>enable</Nullable> |
|||
<IsAspireSharedProject>true</IsAspireSharedProject> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<FrameworkReference Include="Microsoft.AspNetCore.App" /> |
|||
|
|||
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.3.0" /> |
|||
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.0-preview.7.24251.11" /> |
|||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.8.1" /> |
|||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.1" /> |
|||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" /> |
|||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" /> |
|||
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.0" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -1 +0,0 @@ |
|||
{} |
|||
Loading…
Reference in new issue