Skip to content

Commit 73bfe35

Browse files
committed
Add crash_datadog tag if callstack is suspicious
1 parent 626f21b commit 73bfe35

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tracer/src/Datadog.Trace.Tools.dd_dotnet/CreatedumpCommand.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ private unsafe void GenerateCrashReport(int pid, int? signal, int? crashThread)
714714
}
715715

716716
DebugPrint("Setting crash report metadata");
717-
_ = SetMetadata(crashReport, _runtime, exception);
717+
_ = SetMetadata(crashReport, _runtime, exception, isSuspicious);
718718

719719
try
720720
{
@@ -810,7 +810,7 @@ private bool SetSignal(ICrashReport crashReport, int signal)
810810
return true;
811811
}
812812

813-
private unsafe bool SetMetadata(ICrashReport crashReport, ClrRuntime runtime, ClrException? exception)
813+
private unsafe bool SetMetadata(ICrashReport crashReport, ClrRuntime runtime, ClrException? exception, bool isSuspicious)
814814
{
815815
var flavor = runtime.ClrInfo.Flavor switch
816816
{
@@ -853,7 +853,12 @@ private unsafe bool SetMetadata(ICrashReport crashReport, ClrRuntime runtime, Cl
853853

854854
if (exception != null)
855855
{
856-
tags = [.. tags, ("exception", exception.ToString())];
856+
tags = [.. tag, ("exception", exception.ToString())];
857+
}
858+
859+
if (isSuspicious)
860+
{
861+
tags = [.. tag, ("crash_datadog", "true")];
857862
}
858863

859864
var bag = new List<IntPtr>();

0 commit comments

Comments
 (0)