Skip to content

Commit

Permalink
Merge branch 'main' into reyang/fix-ilogger-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang authored Oct 12, 2023
2 parents e1a26e6 + 8cc43f2 commit fb57ecb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci-aot-md.yml
Original file line number Diff line number Diff line change
@@ -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"'
1 change: 1 addition & 0 deletions OpenTelemetry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,13 @@ public void LoggerProcessStateSkipped(string type, string reason)
#if DEBUG
public class OpenTelemetryEventListener : EventListener
{
private readonly List<EventSource> eventSources = new();
private readonly Dictionary<string, EventSource> 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();
Expand All @@ -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);
}

Expand 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)
{
Expand Down

0 comments on commit fb57ecb

Please sign in to comment.