Skip to content

Commit 974f64b

Browse files
authored
fix(collector): print the real hostname if an error happens
1 parent dc91f30 commit 974f64b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/agent/api/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ CollectorApi.prototype._send = function (destinationUrl, data) {
7979
debug('sending data to trace servers: ', destinationUrl, payload)
8080

8181
req.on('error', function (error) {
82-
console.error('error: [trace]', 'There was an error connecting to the Trace servers. Make sure your servers can reach trace-collector-api.risingstack.com')
82+
console.error('error: [trace]', 'There was an error connecting to the Trace servers. Make sure your servers can reach', opts.hostname)
8383
debug('error connecting to the Trace servers', error)
8484
})
8585
req.write(payload)
@@ -237,7 +237,7 @@ CollectorApi.prototype.getService = function (cb) {
237237
debug('getting serviceKey with payload:', payload)
238238

239239
req.on('error', function (error) {
240-
console.error('error: [trace]', 'There was an error connecting to the Trace servers. Make sure your servers can reach trace-collector-api.risingstack.com')
240+
console.error('error: [trace]', 'There was an error connecting to the Trace servers. Make sure your servers can reach', opts.hostname)
241241
debug('error connecting to the Trace servers', error)
242242
})
243243
req.write(payload)

0 commit comments

Comments
 (0)