Skip to content

Commit 518ed8e

Browse files
committed
update debugger type and forwarding based on new logic
1 parent 801c672 commit 518ed8e

File tree

5 files changed

+11
-20
lines changed

5 files changed

+11
-20
lines changed

tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionReplaySnapshotCreator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public ExceptionReplaySnapshotCreator(bool isFullSnapshot, ProbeLocation locatio
3030

3131
internal static string FrameIndex { get; } = Guid.NewGuid().ToString();
3232

33-
internal override string DebuggerProduct => DebuggerTags.DebuggerProduct.ER;
33+
internal override string DebuggerType => DebuggerTags.DebuggerType.ExceptionReplaySnapshot;
3434

3535
internal override DebuggerSnapshotCreator EndSnapshot()
3636
{

tracer/src/Datadog.Trace/Debugger/Models/Snapshot.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,10 @@ internal static class DebuggerTags
5656
/// </summary>
5757
internal static class DebuggerType
5858
{
59-
internal const string Snapshot = "snapshot";
59+
internal const string DynamicInstrumentationSnapshot = "di_snapshot";
60+
internal const string ExceptionReplaySnapshot = "er_snapshot";
6061
internal const string Diagnostic = "diagnostic";
6162
internal const string SymDb = "symdb";
6263
}
63-
64-
/// <summary>
65-
/// Tags for debugger.product
66-
/// </summary>
67-
internal static class DebuggerProduct
68-
{
69-
internal const string DI = "di";
70-
internal const string ER = "er";
71-
internal const string LD = "ld";
72-
}
7364
}
7465
}

tracer/src/Datadog.Trace/Debugger/Snapshots/DebuggerSnapshotCreator.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public DebuggerSnapshotCreator(bool isFullSnapshot, ProbeLocation location, bool
6666
MethodScopeMembers = methodScopeMembers;
6767
}
6868

69-
internal virtual string DebuggerProduct => DebuggerTags.DebuggerProduct.DI;
69+
internal virtual string DebuggerType => DebuggerTags.DebuggerType.DynamicInstrumentationSnapshot;
7070

7171
internal string SnapshotId
7272
{
@@ -883,10 +883,7 @@ internal DebuggerSnapshotCreator AddGeneralInfo(string service, string traceId,
883883
JsonWriter.WriteValue(spanId);
884884

885885
JsonWriter.WritePropertyName("debugger.type");
886-
JsonWriter.WriteValue(DebuggerTags.DebuggerType.Snapshot);
887-
888-
JsonWriter.WritePropertyName("debugger.product");
889-
JsonWriter.WriteValue(DebuggerProduct);
886+
JsonWriter.WriteValue(DebuggerType);
890887

891888
return this;
892889
}

tracer/src/Datadog.Trace/Debugger/Upload/DebuggerUploadApiBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Datadog.Trace.Debugger.Upload;
1919

2020
internal abstract class DebuggerUploadApiBase : IBatchUploadApi
2121
{
22-
protected const string Debuggerv1Endpoint = "debugger/v1/input";
22+
private const string DebuggerV1Endpoint = "debugger/v1/input";
2323

2424
private readonly IApiRequestFactory _apiRequestFactory;
2525
private readonly IGitMetadataTagsProvider? _gitMetadataTagsProvider;
@@ -60,7 +60,7 @@ protected string? Endpoint
6060
protected Task<IApiResponse> PostAsync(string uri, ArraySegment<byte> data)
6161
{
6262
var request = _apiRequestFactory.Create(new Uri(uri));
63-
var isDebuggerV1 = uri.Contains(Debuggerv1Endpoint);
63+
var isDebuggerV1 = uri.Contains(DebuggerV1Endpoint);
6464

6565
return isDebuggerV1
6666
? request.PostAsync(data, MimeTypes.Json)

tracer/src/Datadog.Trace/Debugger/Upload/SnapshotUploadApi.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ private SnapshotUploadApi(
2323
IGitMetadataTagsProvider gitMetadataTagsProvider)
2424
: base(apiRequestFactory, gitMetadataTagsProvider)
2525
{
26-
discoveryService.SubscribeToChanges(c => Endpoint = c.DebuggerV2Endpoint);
26+
discoveryService.SubscribeToChanges(c =>
27+
{
28+
Endpoint = c.DebuggerV2Endpoint ?? c.DiagnosticsEndpoint ?? c.DebuggerEndpoint;
29+
});
2730
}
2831

2932
public static SnapshotUploadApi Create(

0 commit comments

Comments
 (0)