add trace and debug agent to metrics

This commit is contained in:
Henry Oswald 2018-10-16 17:19:21 +01:00
parent 4b075db038
commit 7e359c9df2
2 changed files with 23 additions and 2 deletions

View file

@ -14,11 +14,30 @@ destructors = []
require "./uv_threadpool_size"
traceAgent = require('@google-cloud/trace-agent')
debugAgent = require('@google-cloud/debug-agent')
.start({
serviceContext: {
allowExpressions: true,
service: 'filestore-readonly',
version: '0.0.1'
}
});
module.exports = Metrics =
initialize: (_name) ->
name = _name
collectDefaultMetrics({ timeout: 5000, prefix: name })
traceAgent.start()
debugAgent.start({
serviceContext: {
allowExpressions: true,
service: name,
version: '0.0.1'
}
})
registerDestructor: (func) ->
destructors.push func

View file

@ -22,6 +22,8 @@
"grunt-execute": "^0.2.2",
"grunt-mocha-test": "^0.11.0",
"sandboxed-module": "",
"sinon": ""
"sinon": "",
"@google-cloud/debug-agent": "^3.0.0",
"@google-cloud/trace-agent": "^3.2.0"
}
}