From c59d7690838a72090f54fa639d2a8d160d71d230 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Wed, 31 Jan 2024 05:32:33 +0000 Subject: [PATCH] Add process metrics to service defaults (#1981) Add to the default template and playgrounds. Resolves #1911. --- Directory.Packages.props | 1 + playground/Playground.ServiceDefaults/Extensions.cs | 1 + .../Playground.ServiceDefaults/Playground.ServiceDefaults.csproj | 1 + playground/eShopLite/ServiceDefaults/Extensions.cs | 1 + playground/eShopLite/ServiceDefaults/ServiceDefaults.csproj | 1 + playground/orleans/OrleansServiceDefaults/Extensions.cs | 1 + .../orleans/OrleansServiceDefaults/OrleansServiceDefaults.csproj | 1 + .../AspireApplication.1.ServiceDefaults.csproj | 1 + .../AspireApplication.1.ServiceDefaults/Extensions.cs | 1 + .../aspire-servicedefaults/Aspire.ServiceDefaults1.csproj | 1 + .../templates/aspire-servicedefaults/Extensions.cs | 1 + .../AspireStarterApplication.1.ServiceDefaults.csproj | 1 + .../AspireStarterApplication.1.ServiceDefaults/Extensions.cs | 1 + 13 files changed, 13 insertions(+) diff --git a/Directory.Packages.props b/Directory.Packages.props index 27129358f6..b2984ccec8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -108,6 +108,7 @@ + diff --git a/playground/Playground.ServiceDefaults/Extensions.cs b/playground/Playground.ServiceDefaults/Extensions.cs index 8d81c27847..22b7e96356 100644 --- a/playground/Playground.ServiceDefaults/Extensions.cs +++ b/playground/Playground.ServiceDefaults/Extensions.cs @@ -47,6 +47,7 @@ public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicati { metrics.AddAspNetCoreInstrumentation() .AddHttpClientInstrumentation() + .AddProcessInstrumentation() .AddRuntimeInstrumentation(); }) .WithTracing(tracing => diff --git a/playground/Playground.ServiceDefaults/Playground.ServiceDefaults.csproj b/playground/Playground.ServiceDefaults/Playground.ServiceDefaults.csproj index 38162021b0..f518cfc434 100644 --- a/playground/Playground.ServiceDefaults/Playground.ServiceDefaults.csproj +++ b/playground/Playground.ServiceDefaults/Playground.ServiceDefaults.csproj @@ -17,6 +17,7 @@ + diff --git a/playground/eShopLite/ServiceDefaults/Extensions.cs b/playground/eShopLite/ServiceDefaults/Extensions.cs index fac619ca2c..fd1b5e226a 100644 --- a/playground/eShopLite/ServiceDefaults/Extensions.cs +++ b/playground/eShopLite/ServiceDefaults/Extensions.cs @@ -44,6 +44,7 @@ public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicati { metrics.AddAspNetCoreInstrumentation() .AddHttpClientInstrumentation() + .AddProcessInstrumentation() .AddRuntimeInstrumentation(); }) .WithTracing(tracing => diff --git a/playground/eShopLite/ServiceDefaults/ServiceDefaults.csproj b/playground/eShopLite/ServiceDefaults/ServiceDefaults.csproj index f7e46bf195..7ffc7c55d6 100644 --- a/playground/eShopLite/ServiceDefaults/ServiceDefaults.csproj +++ b/playground/eShopLite/ServiceDefaults/ServiceDefaults.csproj @@ -14,6 +14,7 @@ + diff --git a/playground/orleans/OrleansServiceDefaults/Extensions.cs b/playground/orleans/OrleansServiceDefaults/Extensions.cs index 427c302f5c..aa85604fa8 100644 --- a/playground/orleans/OrleansServiceDefaults/Extensions.cs +++ b/playground/orleans/OrleansServiceDefaults/Extensions.cs @@ -44,6 +44,7 @@ public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicati { metrics.AddAspNetCoreInstrumentation() .AddHttpClientInstrumentation() + .AddProcessInstrumentation() .AddRuntimeInstrumentation() .AddMeter("Microsoft.Orleans"); }) diff --git a/playground/orleans/OrleansServiceDefaults/OrleansServiceDefaults.csproj b/playground/orleans/OrleansServiceDefaults/OrleansServiceDefaults.csproj index f7e46bf195..7ffc7c55d6 100644 --- a/playground/orleans/OrleansServiceDefaults/OrleansServiceDefaults.csproj +++ b/playground/orleans/OrleansServiceDefaults/OrleansServiceDefaults.csproj @@ -14,6 +14,7 @@ + diff --git a/src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.ServiceDefaults/AspireApplication.1.ServiceDefaults.csproj b/src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.ServiceDefaults/AspireApplication.1.ServiceDefaults.csproj index 2f6b36c6c0..19a65b2c96 100644 --- a/src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.ServiceDefaults/AspireApplication.1.ServiceDefaults.csproj +++ b/src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.ServiceDefaults/AspireApplication.1.ServiceDefaults.csproj @@ -18,6 +18,7 @@ + diff --git a/src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.ServiceDefaults/Extensions.cs b/src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.ServiceDefaults/Extensions.cs index fac619ca2c..fd1b5e226a 100644 --- a/src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.ServiceDefaults/Extensions.cs +++ b/src/Aspire.ProjectTemplates/templates/aspire-empty/AspireApplication.1.ServiceDefaults/Extensions.cs @@ -44,6 +44,7 @@ public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicati { metrics.AddAspNetCoreInstrumentation() .AddHttpClientInstrumentation() + .AddProcessInstrumentation() .AddRuntimeInstrumentation(); }) .WithTracing(tracing => diff --git a/src/Aspire.ProjectTemplates/templates/aspire-servicedefaults/Aspire.ServiceDefaults1.csproj b/src/Aspire.ProjectTemplates/templates/aspire-servicedefaults/Aspire.ServiceDefaults1.csproj index 2f6b36c6c0..19a65b2c96 100644 --- a/src/Aspire.ProjectTemplates/templates/aspire-servicedefaults/Aspire.ServiceDefaults1.csproj +++ b/src/Aspire.ProjectTemplates/templates/aspire-servicedefaults/Aspire.ServiceDefaults1.csproj @@ -18,6 +18,7 @@ + diff --git a/src/Aspire.ProjectTemplates/templates/aspire-servicedefaults/Extensions.cs b/src/Aspire.ProjectTemplates/templates/aspire-servicedefaults/Extensions.cs index fac619ca2c..fd1b5e226a 100644 --- a/src/Aspire.ProjectTemplates/templates/aspire-servicedefaults/Extensions.cs +++ b/src/Aspire.ProjectTemplates/templates/aspire-servicedefaults/Extensions.cs @@ -44,6 +44,7 @@ public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicati { metrics.AddAspNetCoreInstrumentation() .AddHttpClientInstrumentation() + .AddProcessInstrumentation() .AddRuntimeInstrumentation(); }) .WithTracing(tracing => diff --git a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ServiceDefaults/AspireStarterApplication.1.ServiceDefaults.csproj b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ServiceDefaults/AspireStarterApplication.1.ServiceDefaults.csproj index 2f6b36c6c0..19a65b2c96 100644 --- a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ServiceDefaults/AspireStarterApplication.1.ServiceDefaults.csproj +++ b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ServiceDefaults/AspireStarterApplication.1.ServiceDefaults.csproj @@ -18,6 +18,7 @@ + diff --git a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ServiceDefaults/Extensions.cs b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ServiceDefaults/Extensions.cs index fac619ca2c..fd1b5e226a 100644 --- a/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ServiceDefaults/Extensions.cs +++ b/src/Aspire.ProjectTemplates/templates/aspire-starter/AspireStarterApplication.1.ServiceDefaults/Extensions.cs @@ -44,6 +44,7 @@ public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicati { metrics.AddAspNetCoreInstrumentation() .AddHttpClientInstrumentation() + .AddProcessInstrumentation() .AddRuntimeInstrumentation(); }) .WithTracing(tracing =>