From a4959834d0362fe63fc7a288fc089df293bd2e21 Mon Sep 17 00:00:00 2001 From: Rajkumar Rangaraj Date: Fri, 27 Mar 2026 16:39:22 -0700 Subject: [PATCH 1/3] Add OpenTelemetry forwarder infrastructure - Add OpenTelemetry.OutOfProcess.Forwarder.Configuration 0.1.0-beta.1 package version - Add ENABLE_OTEL conditional compilation: when set, adds package reference and defines BUILDING_OTEL preprocessor symbol - Set ENABLE_OTEL in generate-dev-sln.ps1 for dev builds - Fix missing newline at end of generate-dev-sln.ps1 --- Directory.Packages.props | 1 + generate-dev-sln.ps1 | 1 + src/Tools/dotnet-monitor/dotnet-monitor.csproj | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/Directory.Packages.props b/Directory.Packages.props index f37bd594e4c..9c25c8b1d13 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -26,6 +26,7 @@ + diff --git a/generate-dev-sln.ps1 b/generate-dev-sln.ps1 index fec6c0823db..1ca59051850 100644 --- a/generate-dev-sln.ps1 +++ b/generate-dev-sln.ps1 @@ -10,6 +10,7 @@ $ErrorActionPreference = 'Stop' $resolvedPath = Resolve-Path $DiagRepoRoot $env:DIAGNOSTICS_REPO_ROOT=$resolvedPath +$env:ENABLE_OTEL="true" #Generates a solution that spans both the diagnostics and the dotnet-monitor repo. #This can be used to build both projects in VS. diff --git a/src/Tools/dotnet-monitor/dotnet-monitor.csproj b/src/Tools/dotnet-monitor/dotnet-monitor.csproj index 34993f9604f..a38477bb388 100644 --- a/src/Tools/dotnet-monitor/dotnet-monitor.csproj +++ b/src/Tools/dotnet-monitor/dotnet-monitor.csproj @@ -28,6 +28,10 @@ + + + + @@ -36,6 +40,10 @@ + + $(DefineConstants);BUILDING_OTEL + + From d54b0b5ce87c82da54f8da2686fc3084ea740d04 Mon Sep 17 00:00:00 2001 From: Rajkumar Rangaraj Date: Fri, 3 Apr 2026 15:54:16 -0700 Subject: [PATCH 2/3] Make OpenTelemetry package reference and BUILDING_OTEL unconditional Address review feedback: remove ENABLE_OTEL gating so the package is always referenced and BUILDING_OTEL is always defined, avoiding the need for two separate builds. --- generate-dev-sln.ps1 | 1 - src/Tools/dotnet-monitor/dotnet-monitor.csproj | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/generate-dev-sln.ps1 b/generate-dev-sln.ps1 index 1ca59051850..fec6c0823db 100644 --- a/generate-dev-sln.ps1 +++ b/generate-dev-sln.ps1 @@ -10,7 +10,6 @@ $ErrorActionPreference = 'Stop' $resolvedPath = Resolve-Path $DiagRepoRoot $env:DIAGNOSTICS_REPO_ROOT=$resolvedPath -$env:ENABLE_OTEL="true" #Generates a solution that spans both the diagnostics and the dotnet-monitor repo. #This can be used to build both projects in VS. diff --git a/src/Tools/dotnet-monitor/dotnet-monitor.csproj b/src/Tools/dotnet-monitor/dotnet-monitor.csproj index a38477bb388..48f04e6a89e 100644 --- a/src/Tools/dotnet-monitor/dotnet-monitor.csproj +++ b/src/Tools/dotnet-monitor/dotnet-monitor.csproj @@ -24,14 +24,11 @@ + - - - - @@ -40,7 +37,7 @@ - + $(DefineConstants);BUILDING_OTEL From f52f7cd7b4ee5b454906eedc68f4829ea1f77038 Mon Sep 17 00:00:00 2001 From: Rajkumar Rangaraj Date: Fri, 3 Apr 2026 16:02:27 -0700 Subject: [PATCH 3/3] Remove BUILDING_OTEL define --- src/Tools/dotnet-monitor/dotnet-monitor.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Tools/dotnet-monitor/dotnet-monitor.csproj b/src/Tools/dotnet-monitor/dotnet-monitor.csproj index 48f04e6a89e..9d276e9522b 100644 --- a/src/Tools/dotnet-monitor/dotnet-monitor.csproj +++ b/src/Tools/dotnet-monitor/dotnet-monitor.csproj @@ -37,10 +37,6 @@ - - $(DefineConstants);BUILDING_OTEL - -