add profiler

This commit is contained in:
Henry Oswald 2018-12-12 20:11:40 +00:00
parent 9eac49ad84
commit a86c4d8abd
2 changed files with 13 additions and 1 deletions

View file

@ -34,8 +34,19 @@ module.exports = Metrics =
logger.log("starting google debug agent")
debugAgent = require('@google-cloud/debug-agent')
debugAgent.start({
allowExpressions: true,
serviceContext: {
service: appname,
version: process.env['BUILD_VERSION']
}
})
logger.log("ENABLE_PROFILER_AGENT set to #{process.env['ENABLE_PROFILER_AGENT']}")
if process.env['ENABLE_PROFILER_AGENT'] == "true"
logger.log("starting google profile agent")
profiler = require('@google-cloud/profiler')
profiler.start({
serviceContext: {
allowExpressions: true,
service: appname,
version: process.env['BUILD_VERSION']
}

View file

@ -12,6 +12,7 @@
"prom-client": "^11.1.3",
"underscore": "~1.6.0",
"@google-cloud/debug-agent": "^3.0.0",
"@google-cloud/profiler": "0.2.3",
"@google-cloud/trace-agent": "^3.2.0"
},
"devDependencies": {