Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
💬 Add more client properties for help tracking rogue consumers
Browse files Browse the repository at this point in the history
Includes hostname, platform, PID and node versions
  • Loading branch information
jpwilliams committed Oct 4, 2017
1 parent 30e1e8f commit f0c42b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion utils/generateConnectionOptions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const os = require('os')
const packageJson = require('../package.json')

function generateConnectionOptions (name) {
Expand All @@ -6,7 +7,13 @@ function generateConnectionOptions (name) {
connection_name: name,
powered_by: `${packageJson.name}@${packageJson.version} (${packageJson.repository.url.substr(0, packageJson.repository.url.length - 4)}/tree/${packageJson.version})`,
repository: packageJson.repository.url,
package: `https://www.npmjs.com/package/${packageJson.name}`
package: `https://www.npmjs.com/package/${packageJson.name}`,
host: {
name: os.hostname(),
platform: `${os.type()}@${os.release()}`,
pid: process.pid,
node: process.version
}
}
}
}
Expand Down

0 comments on commit f0c42b1

Please sign in to comment.