Skip to content

Commit 316859e

Browse files
peteyyczgergelyke
authored andcommitted
feat(clientSend): add host and url to client send
1 parent 11c07c0 commit 316859e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

lib/providers/httpTransaction/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ HttpTransaction.prototype.onClientSend = function (data) {
111111
}
112112

113113
trace.events.push({
114+
host: data.host,
115+
url: data.url,
114116
id: spanId,
115117
method: data.method,
116118
time: data.time,

lib/providers/httpTransaction/index.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ describe('The HttpTransaction module', function () {
125125
id: spanId,
126126
time: time,
127127
method: method,
128-
type: 'cs'
128+
type: 'cs',
129+
url: '/fruits/pear',
130+
host: 'localhost:3000'
129131
}
130132
]
131133
}

lib/providers/httpTransaction/wraps/http.request.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function wrapRequest (original, collector, config) {
4848

4949
var collectorDataBag = {
5050
id: requestId,
51-
host: requestParams.host + ':' + requestParams.port,
51+
host: requestParams.host,
5252
url: requestParams.pathname,
5353
time: clientSendTime,
5454
headers: requestParams.headers,
@@ -69,7 +69,7 @@ function wrapRequest (original, collector, config) {
6969
returned.on('error', function (err) {
7070
var collectorDataBag = {
7171
id: requestId,
72-
host: requestParams.host + ':' + requestParams.port,
72+
host: requestParams.host,
7373
url: requestParams.pathname,
7474
time: microtime.now(),
7575
headers: requestParams.headers,
@@ -82,7 +82,7 @@ function wrapRequest (original, collector, config) {
8282
returned.on('response', function (incomingMessage) {
8383
var collectorDataBag = {
8484
id: requestId,
85-
host: requestParams.host + ':' + requestParams.port,
85+
host: requestParams.host,
8686
url: requestParams.pathname,
8787
time: microtime.now(),
8888
headers: incomingMessage.headers,

0 commit comments

Comments
 (0)