From d75902e6eb89fd5dbcc025dc452fad646017b7c6 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:31:57 -0500 Subject: [PATCH] DEBUG-2334 correctly serialize debugger input payloads (#4125) --- lib/datadog/di/probe_notification_builder.rb | 4 ++-- lib/datadog/di/transport.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/datadog/di/probe_notification_builder.rb b/lib/datadog/di/probe_notification_builder.rb index 4c5ad19d23c..c8634ac4364 100644 --- a/lib/datadog/di/probe_notification_builder.rb +++ b/lib/datadog/di/probe_notification_builder.rb @@ -135,8 +135,8 @@ def build_snapshot(probe, rv: nil, snapshot: nil, path: nil, version: 2, }, # TODO add tests that the trace/span id is correctly propagated - "dd.trace_id": Datadog::Tracing.active_trace&.id, - "dd.span_id": Datadog::Tracing.active_span&.id, + "dd.trace_id": Datadog::Tracing.active_trace&.id&.to_s, + "dd.span_id": Datadog::Tracing.active_span&.id&.to_s, ddsource: 'dd_debugger', message: probe.template && evaluate_template(probe.template, duration: duration ? duration * 1000 : nil), diff --git a/lib/datadog/di/transport.rb b/lib/datadog/di/transport.rb index 2907caa1fdb..3aac5f402d8 100644 --- a/lib/datadog/di/transport.rb +++ b/lib/datadog/di/transport.rb @@ -44,7 +44,7 @@ def send_diagnostics(payload) def send_input(payload) send_request('Probe snapshot submission', - path: INPUT_PATH, body: payload.to_s, + path: INPUT_PATH, body: payload.to_json, headers: {'content-type' => 'application/json'},) end