Adds option to disable Stackdriver Export (#293)

This commit is contained in:
Megan O'Keefe 2020-02-20 15:26:44 -05:00 committed by GitHub
parent 595bd21d38
commit 90f9287f3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 267 additions and 75 deletions

View file

@ -14,19 +14,40 @@
* limitations under the License.
*/
require('@google-cloud/profiler').start({
serviceContext: {
service: 'currencyservice',
version: '1.0.0'
}
});
require('@google-cloud/trace-agent').start();
require('@google-cloud/debug-agent').start({
serviceContext: {
service: 'currencyservice',
version: 'VERSION'
}
});
if(process.env.DISABLE_PROFILER) {
console.log("Profiler disabled.")
}
else {
console.log("Profiler enabled.")
require('@google-cloud/profiler').start({
serviceContext: {
service: 'currencyservice',
version: '1.0.0'
}
});
}
if(process.env.DISABLE_TRACING) {
console.log("Tracing disabled.")
}
else {
console.log("Tracing enabled.")
require('@google-cloud/trace-agent').start();
}
if(process.env.DISABLE_DEBUGGER) {
console.log("Debugger disabled.")
}
else {
console.log("Debugger enabled.")
require('@google-cloud/debug-agent').start({
serviceContext: {
service: 'currencyservice',
version: 'VERSION'
}
});
}
const path = require('path');
const grpc = require('grpc');