From 8cc43f23e2c9f863b67c22c28bc21b54b4e0f963 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Thu, 12 Oct 2023 11:05:16 -0700 Subject: [PATCH 1/4] [sdk] Ignore event counters in debug EventListener (#4942) --- .../Internal/OpenTelemetrySdkEventSource.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs b/src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs index ab536f670c..1cbba26f9f 100644 --- a/src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs +++ b/src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs @@ -350,13 +350,13 @@ public void LoggerProcessStateSkipped(string type, string reason) #if DEBUG public class OpenTelemetryEventListener : EventListener { - private readonly List eventSources = new(); + private readonly Dictionary eventSources = new(); public override void Dispose() { - foreach (EventSource eventSource in this.eventSources) + foreach (var kvp in this.eventSources) { - this.DisableEvents(eventSource); + this.DisableEvents(kvp.Value); } base.Dispose(); @@ -367,7 +367,7 @@ protected override void OnEventSourceCreated(EventSource eventSource) { if (eventSource.Name.StartsWith("OpenTelemetry", StringComparison.OrdinalIgnoreCase)) { - this.eventSources.Add(eventSource); + this.eventSources.Add(eventSource.Name, eventSource); this.EnableEvents(eventSource, EventLevel.Verbose, EventKeywords.All); } @@ -376,6 +376,11 @@ protected override void OnEventSourceCreated(EventSource eventSource) protected override void OnEventWritten(EventWrittenEventArgs e) { + if (!this.eventSources.ContainsKey(e.EventSource.Name)) + { + return; + } + string? message; if (e.Message != null && e.Payload != null && e.Payload.Count > 0) { From 865bcb64a5c67d713ded373a2839c49dba07dfc2 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Thu, 12 Oct 2023 18:04:18 -0700 Subject: [PATCH 2/4] [repo] Package validation tweaks deux (#4927) --- Directory.Packages.props | 8 -------- NuGet.config | 4 ---- build/Common.prod.props | 1 + src/Directory.Build.targets | 2 ++ 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index fd00f3ef3d..23cee35001 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,13 +4,6 @@ 1.6.0 - - - true - $(OTelLatestStableVer) - - - @@ -17,9 +16,6 @@ - - - diff --git a/build/Common.prod.props b/build/Common.prod.props index af8760b3ad..baca9ebdff 100644 --- a/build/Common.prod.props +++ b/build/Common.prod.props @@ -4,6 +4,7 @@ $(MSBuildThisFileDirectory)/OpenTelemetry.prod.ruleset true + false diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 48cad82a63..203352a3f7 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -1,6 +1,8 @@ + + $(OTelLatestStableVer) $([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)')) From b091af1899b66a516d753109ce6bf8182be416e0 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Fri, 13 Oct 2023 09:36:29 -0700 Subject: [PATCH 3/4] [ASP.NET Core] Disable Flaky test (#4947) --- .../BasicTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs index 184422e953..87a70d3bfb 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs @@ -912,7 +912,7 @@ void ConfigureTestServices(IServiceCollection services) Assert.Equal(4, numberofSubscribedEvents); } - [Fact] + [Fact(Skip = "https://github.com/open-telemetry/opentelemetry-dotnet/issues/4884")] public async Task DiagnosticSourceExceptionCallBackIsNotReceivedForExceptionsHandledInMiddleware() { int numberOfUnSubscribedEvents = 0; From 18c85fa403dcac64ec2159461e5b7d343a9212b4 Mon Sep 17 00:00:00 2001 From: Reiley Yang Date: Fri, 13 Oct 2023 12:22:35 -0700 Subject: [PATCH 4/4] Bump Microsoft.Extensions.Logging to net8 - part 2 (#4933) --- .github/workflows/ci-instrumentation-libraries.yml | 9 +++------ Directory.Packages.props | 3 +++ build/InstrumentationLibraries.proj | 6 +++++- docs/logs/correlation/correlation.csproj | 1 - .../customizing-the-sdk/customizing-the-sdk.csproj | 1 - docs/logs/extending-the-sdk/extending-the-sdk.csproj | 1 - .../getting-started-aspnetcore.csproj | 1 - .../getting-started-console.csproj | 1 - docs/logs/redaction/redaction.csproj | 1 - .../OpenTelemetry.Instrumentation.AspNetCore.csproj | 2 +- ...penTelemetry.Instrumentation.GrpcNetClient.csproj | 2 +- .../OpenTelemetry.Instrumentation.Http.csproj | 2 +- .../OpenTelemetry.Instrumentation.SqlClient.csproj | 2 +- src/OpenTelemetry/CHANGELOG.md | 5 +++++ .../ProviderBuilderServiceCollectionExtensions.cs | 2 +- .../Logs/ILogger/OpenTelemetryLogger.cs | 3 ++- src/OpenTelemetry/OpenTelemetry.csproj | 1 + src/Shared/Options/ConfigurationExtensions.cs | 4 ++-- test/Benchmarks/Benchmarks.csproj | 1 - ...Telemetry.Instrumentation.AspNetCore.Tests.csproj | 11 ++++++++++- .../OpenTelemetry.Instrumentation.Grpc.Tests.csproj | 12 ++++++++++-- .../OpenTelemetry.Instrumentation.Http.Tests.csproj | 7 +++++++ ...etry.Instrumentation.W3cTraceContext.Tests.csproj | 2 -- .../OpenTelemetry.Tests.Stress.Logs.csproj | 1 - test/OpenTelemetry.Tests/OpenTelemetry.Tests.csproj | 1 - test/TestApp.AspNetCore/TestApp.AspNetCore.csproj | 9 +++++---- 26 files changed, 58 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci-instrumentation-libraries.yml b/.github/workflows/ci-instrumentation-libraries.yml index 546a0ae744..35408d1425 100644 --- a/.github/workflows/ci-instrumentation-libraries.yml +++ b/.github/workflows/ci-instrumentation-libraries.yml @@ -23,9 +23,6 @@ jobs: runs-on: ${{ matrix.os }} - env: - RunningDotNetPack: true - steps: - uses: actions/checkout@v4 with: @@ -35,10 +32,10 @@ jobs: uses: actions/setup-dotnet@v3 - name: Install dependencies - run: dotnet restore ./build/InstrumentationLibraries.proj + run: dotnet restore ./build/InstrumentationLibraries.proj -p:RunningDotNetPack=true - name: Build - run: dotnet build ./build/InstrumentationLibraries.proj --configuration Release --no-restore + run: dotnet build ./build/InstrumentationLibraries.proj --configuration Release --no-restore -p:RunningDotNetPack=true - name: Test ${{ matrix.version }} - run: dotnet test **/bin/Release/${{ matrix.version }}/OpenTelemetry.Instrumentation*.Tests.dll --logger:"console;verbosity=detailed" + run: dotnet test **/bin/Release/${{ matrix.version }}/OpenTelemetry.Instrumentation*.Tests.dll --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed" diff --git a/Directory.Packages.props b/Directory.Packages.props index 23cee35001..a2245fd931 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -34,7 +34,10 @@ + + +