diff --git a/packages/dd-trace/src/debugger/devtools_client/index.js b/packages/dd-trace/src/debugger/devtools_client/index.js index be466b06bd9..55afe4e62a2 100644 --- a/packages/dd-trace/src/debugger/devtools_client/index.js +++ b/packages/dd-trace/src/debugger/devtools_client/index.js @@ -146,10 +146,9 @@ session.on('Debugger.paused', async ({ params }) => { } } + ackEmitting(probe) // TODO: Process template (DEBUG-2628) - send(probe.template, logger, dd, snapshot, () => { - ackEmitting(probe) - }) + send(probe.template, logger, dd, snapshot) } }) diff --git a/packages/dd-trace/src/debugger/devtools_client/send.js b/packages/dd-trace/src/debugger/devtools_client/send.js index da366394868..ce42e6d8b36 100644 --- a/packages/dd-trace/src/debugger/devtools_client/send.js +++ b/packages/dd-trace/src/debugger/devtools_client/send.js @@ -29,10 +29,9 @@ const ddtags = [ const path = `/debugger/v1/input?${stringify({ ddtags })}` -let callbacks = [] const jsonBuffer = new JSONBuffer({ size: config.maxTotalPayloadSize, timeout: 1000, onFlush }) -function send (message, logger, dd, snapshot, cb) { +function send (message, logger, dd, snapshot) { const payload = { ddsource, hostname, @@ -58,7 +57,6 @@ function send (message, logger, dd, snapshot, cb) { } jsonBuffer.write(json, size) - callbacks.push(cb) } function onFlush (payload) { @@ -69,11 +67,7 @@ function onFlush (payload) { headers: { 'Content-Type': 'application/json; charset=utf-8' } } - const _callbacks = callbacks - callbacks = [] - request(payload, opts, (err) => { if (err) log.error('[debugger:devtools_client] Error sending probe payload', err) - else _callbacks.forEach(cb => cb()) }) }