mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
gcp stackdriver tracing: attach user id (#11033)
This commit is contained in:
12
website/server/libs/gcpTraceAgent.js
Normal file
12
website/server/libs/gcpTraceAgent.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const nconf = require('nconf');
|
||||
|
||||
const IS_PROD = nconf.get('IS_PROD');
|
||||
const STACKDRIVER_TRACING_ENABLED = nconf.get('ENABLE_STACKDRIVER_TRACING') === 'true';
|
||||
|
||||
let tracer = null;
|
||||
|
||||
if (IS_PROD && STACKDRIVER_TRACING_ENABLED) {
|
||||
tracer = require('@google-cloud/trace-agent').start(); // eslint-disable-line global-require
|
||||
}
|
||||
|
||||
export default tracer;
|
||||
Reference in New Issue
Block a user