Skip to content

Commit

Permalink
add stackdriver config
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Sep 30, 2018
1 parent 711dd56 commit b409abf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ if (process.env.EDGEMICRO_STACKDRIVER) {
if (!process.env.GCP_PROJECT_ID || !process.env.GCP_KEY_FILE) {
console.log("env GCP_PROJECT_ID or GCP_KEY_FILE is missing, skipping trace");
} else {
require('@google-cloud/trace-agent').start({
var stackdriverConfig = require('./stackdriver-config.json');
var stackdriverConfig = Object.assign({
projectId: process.env.GCP_PROJECT_ID,
keyFilename: process.env.GCP_KEY_FILE,
logLevel: 4,
enabled: true,
flushDelaySeconds: 5
});
keyFilename: process.env.GCP_KEY_FILE
},stackdriverConfig);
console.log(stackdriverConfig);
require('@google-cloud/trace-agent').start(stackdriverConfig);
}
}

Expand Down
5 changes: 5 additions & 0 deletions stackdriver-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"logLevel": 4,
"enabled": true,
"flushDelaySeconds": 5
}

0 comments on commit b409abf

Please sign in to comment.