Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/8.0] Prevent collected exceptions from being dropped due to null event values #7302

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public void ExceptionGroup(
public void ExceptionInstance(
ulong ExceptionId,
ulong ExceptionGroupId,
string? ExceptionMessage,
string ExceptionMessage,
ulong[] StackFrameIds,
DateTime Timestamp,
ulong[] InnerExceptionIds,
string? ActivityId,
string ActivityId,
ActivityIdFormat ActivityIdFormat)
{
Span<EventData> data = stackalloc EventData[8];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void Invoke(Exception exception, ExceptionPipelineExceptionContext contex
frameIds,
context.Timestamp,
GetInnerExceptionsIds(exception),
context.ActivityId,
context.ActivityId ?? string.Empty,
context.ActivityIdFormat
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void ExceptionsEventSource_WriteException_LevelTooHigh()
using ExceptionsEventListener listener = new();
listener.EnableEvents(source, EventLevel.Warning);

source.ExceptionInstance(5, 7, ObjectDisposedExceptionMessage, Array.Empty<ulong>(), DateTime.UtcNow, Array.Empty<ulong>(), null, ActivityIdFormat.Unknown);
source.ExceptionInstance(5, 7, ObjectDisposedExceptionMessage, Array.Empty<ulong>(), DateTime.UtcNow, Array.Empty<ulong>(), string.Empty, ActivityIdFormat.Unknown);

Assert.Empty(listener.Exceptions);
}
Expand All @@ -120,7 +120,7 @@ public void ExceptionsEventSource_WriteException_NotEnabled()

using ExceptionsEventListener listener = new();

source.ExceptionInstance(7, 9, OperationCancelledExceptionMessage, Array.Empty<ulong>(), DateTime.UtcNow, Array.Empty<ulong>(), null, ActivityIdFormat.Unknown);
source.ExceptionInstance(7, 9, OperationCancelledExceptionMessage, Array.Empty<ulong>(), DateTime.UtcNow, Array.Empty<ulong>(), string.Empty, ActivityIdFormat.Unknown);

Assert.Empty(listener.Exceptions);
}
Expand Down