-
Notifications
You must be signed in to change notification settings - Fork 345
Closed
Labels
Milestone
Description
Describe the bug
When making a request using a WHATWG URL object (node URL) dd-trace clears the request URL.
The latest Got converts urls before making the request.
Simple example
{
"name": "test",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"dd-trace": "^0.16.3"
}
}
require('dd-trace').default.init(
{
service: 'test',
runtimeMetrics: true,
env: 'test',
logger: {
debug: message => console.log,
error: error => console.error,
},
analytics: true,
logInjection: false,
}
)
const url = 'https://wtfismyip.com/json'
require('https').request(new URL(url), (res) => {
res.on('data', console.log)
res.on('error', console.error)
}).end()
# node index.js
events.js:187
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 127.0.0.1:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14)
Emitted 'error' event on ClientRequest instance at:
at ClientRequest.req.emit (/test/node_modules/dd-trace/packages/datadog-plugin-http/src/client.js:93:21)
at TLSSocket.socketErrorListener (_http_client.js:406:9)
at TLSSocket.emit (events.js:210:5)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 443
}
Environment
- docker node:12
- node 12.13.0
- dd-trace 0.16.3