add if statment around traceagenet and bump to 2.0.8

This commit is contained in:
Henry Oswald 2018-12-05 13:57:53 +00:00
parent 254a508a01
commit 7a227adaeb
2 changed files with 4 additions and 3 deletions

View file

@ -1,5 +1,5 @@
traceAgent = require('@google-cloud/trace-agent')
debugAgent = require('@google-cloud/debug-agent') debugAgent = require('@google-cloud/debug-agent')
traceAgent = require('@google-cloud/trace-agent')
prom = require('prom-client') prom = require('prom-client')
Register = require('prom-client').register Register = require('prom-client').register
@ -21,7 +21,8 @@ module.exports = Metrics =
initialize: (_name) -> initialize: (_name) ->
appname = _name appname = _name
collectDefaultMetrics({ timeout: 5000, prefix: Metrics.buildPromKey()}) collectDefaultMetrics({ timeout: 5000, prefix: Metrics.buildPromKey()})
traceAgent.start() if process.env['ENABLE_TRACE_AGENT'] == "true"
traceAgent.start()
debugAgent.start({ debugAgent.start({
serviceContext: { serviceContext: {
allowExpressions: true, allowExpressions: true,

View file

@ -1,6 +1,6 @@
{ {
"name": "metrics-sharelatex", "name": "metrics-sharelatex",
"version": "2.0.7", "version": "2.0.8",
"description": "A drop-in metrics and monitoring module for node.js apps", "description": "A drop-in metrics and monitoring module for node.js apps",
"repository": { "repository": {
"type": "git", "type": "git",