Skip to content

Commit

Permalink
Merge pull request newrelic#1189 from NodeJS-agent/nwolfe/sup-version
Browse files Browse the repository at this point in the history
Record metric for Node version
  • Loading branch information
Bryan Clement committed Jul 7, 2017
2 parents cb510b3 + b80252c commit f7f2d79
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ function initialize() {

agent.start(function cb_start(error) {
if (!error) {
// TODO: After deprecating Node 0.10 and 0.12, simplify this regex.
var nodeMajor = /^v?((?:0\.)?\d+)/.exec(process.version)
agent.metrics.getOrCreateMetric(
'Supportability/Nodejs/Version/' + ((nodeMajor && nodeMajor[1]) || 'unknown')
)

return logger.debug("New Relic for Node.js is connected to New Relic.")
}

Expand Down

0 comments on commit f7f2d79

Please sign in to comment.