From 59f1d2ce8dbea9ead590a8e184780792c315d4d8 Mon Sep 17 00:00:00 2001 From: Yun-Ting Lin Date: Wed, 11 Oct 2023 16:55:07 -0700 Subject: [PATCH 1/2] unblock documentation-only PRs for aot-ci (#4938) --- .github/workflows/ci-aot-md.yml | 26 ++++++++++++++++++++++++++ OpenTelemetry.sln | 1 + 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/ci-aot-md.yml diff --git a/.github/workflows/ci-aot-md.yml b/.github/workflows/ci-aot-md.yml new file mode 100644 index 0000000000..4d5249296a --- /dev/null +++ b/.github/workflows/ci-aot-md.yml @@ -0,0 +1,26 @@ +# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions +# See also: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks + +# Description: This workflow exists to unblock documentation-only PRs. + +# IMPORTANT: This workflow MUST use the same 'name' and 'matrix' as the non -md workflow. + +name: Publish AOTCompatibility testApp + +on: + pull_request: + branches: [ 'main*' ] + paths: + - '**.md' + +jobs: + aot-test: + strategy: + fail-fast: false # ensures the entire test matrix is run, even if one permutation fails + matrix: + os: [ ubuntu-latest ] + version: [ net8.0 ] + + runs-on: ${{ matrix.os }} + steps: + - run: 'echo "No build required"' diff --git a/OpenTelemetry.sln b/OpenTelemetry.sln index 713d703f81..922ba6b2d2 100644 --- a/OpenTelemetry.sln +++ b/OpenTelemetry.sln @@ -91,6 +91,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E69578EB-B456-4062-A645-877CD964528B}" ProjectSection(SolutionItems) = preProject .github\workflows\ci-aot.yml = .github\workflows\ci-aot.yml + .github\workflows\ci-aot-md.yml = .github\workflows\ci-aot-md.yml .github\workflows\ci-instrumentation-libraries-md.yml = .github\workflows\ci-instrumentation-libraries-md.yml .github\workflows\ci-instrumentation-libraries.yml = .github\workflows\ci-instrumentation-libraries.yml .github\workflows\ci-md.yml = .github\workflows\ci-md.yml From 8cc43f23e2c9f863b67c22c28bc21b54b4e0f963 Mon Sep 17 00:00:00 2001 From: Mikel Blanchard Date: Thu, 12 Oct 2023 11:05:16 -0700 Subject: [PATCH 2/2] [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) {