-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d34e232
commit 57fc175
Showing
48 changed files
with
3,056 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...rc/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/AggregateExceptionRelatedFrames.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// <copyright file="AggregateExceptionRelatedFrames.cs" company="Datadog"> | ||
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. | ||
// </copyright> | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation | ||
{ | ||
internal class AggregateExceptionRelatedFrames : ExceptionRelatedFrames | ||
{ | ||
public AggregateExceptionRelatedFrames(AggregateException ex, ParticipatingFrame[] frames, ExceptionRelatedFrames[] innerFrames) | ||
: base(ex, frames) | ||
{ | ||
InnerFrames = innerFrames; | ||
} | ||
|
||
public ExceptionRelatedFrames[] InnerFrames { get; } | ||
|
||
public override IEnumerable<ParticipatingFrame> GetAllFlattenedFrames() | ||
{ | ||
foreach (var frame in InnerFrames.SelectMany(innerFrame => innerFrame?.GetAllFlattenedFrames())) | ||
{ | ||
yield return frame; | ||
} | ||
|
||
foreach (var frame in Frames) | ||
{ | ||
yield return frame; | ||
} | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/DebuggerSnapshot.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// <copyright file="DebuggerSnapshot.cs" company="Datadog"> | ||
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. | ||
// </copyright> | ||
|
||
using System; | ||
|
||
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation; | ||
|
||
internal class DebuggerSnapshot | ||
{ | ||
public DebuggerSnapshot(string probeId, string snapshot, Exception exceptionThrown, Guid snapshotId) | ||
{ | ||
ProbeId = probeId; | ||
Snapshot = snapshot; | ||
ExceptionThrown = exceptionThrown; | ||
SnapshotId = snapshotId; | ||
} | ||
|
||
public DebuggerSnapshot Child { get; set; } | ||
|
||
public string ProbeId { get; } | ||
|
||
public string Snapshot { get; } | ||
|
||
public Exception ExceptionThrown { get; } | ||
|
||
public Guid SnapshotId { get; } | ||
} |
44 changes: 44 additions & 0 deletions
44
tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ErrorOriginType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// <copyright file="ErrorOriginType.cs" company="Datadog"> | ||
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. | ||
// </copyright> | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation | ||
{ | ||
internal enum ErrorOriginType : byte | ||
{ | ||
/// <summary> | ||
/// A first-chance exception is any exception that is initially thrown. | ||
/// </summary> | ||
FirstChanceException, | ||
|
||
/// <summary> | ||
/// A second chance exception is an unhandled exception that has propagated | ||
/// to the top of the stack and is about to crash the process. | ||
/// </summary> | ||
SecondChanceException, | ||
|
||
/// <summary> | ||
/// An exception that was sent to a logging tool - e.g. via a call to Logger.Error(...) | ||
/// </summary> | ||
LoggedError, | ||
|
||
/// <summary> | ||
/// In ASP.NET / ASP.NET Core / WebAPI etc, an HTTP request failure exception is | ||
/// an exception in that will cause the request to return a failure response code (usually HTTP 500). | ||
/// </summary> | ||
HttpRequestFailure, | ||
|
||
/// <summary> | ||
/// The shadow stack knows when a catch statement ends. When it does, it calls an exception event. | ||
/// For first-chance exception it means this instance will have the full StackTrace. | ||
/// </summary> | ||
ExceptionCaught | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionCollectionState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// <copyright file="ExceptionCollectionState.cs" company="Datadog"> | ||
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. | ||
// </copyright> | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation | ||
{ | ||
internal enum ExceptionCollectionState : byte | ||
{ | ||
Done, | ||
Initializing, | ||
Collecting, | ||
Finalizing, | ||
None | ||
} | ||
} |
Oops, something went wrong.