Skip to content

Commit

Permalink
[sdk] Ignore event counters in SelfDiagnosticsEventListener (#5046)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Nov 14, 2023
1 parent 78ab35c commit ecb5dc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/OpenTelemetry/Internal/SelfDiagnosticsEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,12 @@ protected override void OnEventSourceCreated(EventSource eventSource)
/// <param name="eventData">Data of the EventSource event.</param>
protected override void OnEventWritten(EventWrittenEventArgs eventData)
{
this.WriteEvent(eventData.Message, eventData.Payload);
// Note: The EventSource check here works around a bug in EventListener.
// See: https://github.com/open-telemetry/opentelemetry-dotnet/pull/5046
if (eventData.EventSource.Name.StartsWith(EventSourceNamePrefix, StringComparison.OrdinalIgnoreCase))
{
this.WriteEvent(eventData.Message, eventData.Payload);
}
}

private void Dispose(bool disposing)
Expand Down

0 comments on commit ecb5dc8

Please sign in to comment.