Skip to content

Commit 262bbbd

Browse files
committed
return the falback for diagnostic and send only diagnostic as multipart
1 parent 681c8ba commit 262bbbd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#nullable enable
77
using System;
8+
using System.CodeDom;
89
using System.Threading;
910
using System.Threading.Tasks;
1011
using System.Web;
@@ -62,9 +63,9 @@ protected Task<IApiResponse> PostAsync(string uri, ArraySegment<byte> data)
6263
var request = _apiRequestFactory.Create(new Uri(uri));
6364
var isDebuggerV1 = uri.Contains(DebuggerV1Endpoint);
6465

65-
return isDebuggerV1
66-
? request.PostAsync(data, MimeTypes.Json)
67-
: request.PostAsync([new("event", MimeTypes.Json, "event.json", data)]);
66+
return this is DiagnosticsUploadApi && !isDebuggerV1
67+
? request.PostAsync([new("event", MimeTypes.Json, "event.json", data)])
68+
: request.PostAsync(data, MimeTypes.Json);
6869
}
6970

7071
private string GetDefaultTagsMergedWithGlobalTags()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private DiagnosticsUploadApi(
2525
{
2626
discoveryService.SubscribeToChanges(c =>
2727
{
28-
Endpoint = c.DiagnosticsEndpoint;
28+
Endpoint = c.DiagnosticsEndpoint ?? c.DebuggerEndpoint;
2929
Log.Debug("DiagnosticsUploadApi: Updated endpoint to {Endpoint}", Endpoint);
3030
});
3131
}

0 commit comments

Comments
 (0)