Skip to content

Commit ea819fc

Browse files
authored
Stackdriver samples (#407)
1 parent 17c3c8c commit ea819fc

14 files changed

+727
-458
lines changed

debugger/app.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
* limitations under the License.
1414
*/
1515

16-
// [START app]
16+
// [START debugger_app]
1717
'use strict';
1818

19-
// [START setup]
19+
// [START debugger_setup_implicit]
2020
require('@google-cloud/debug-agent').start();
21+
// [END debugger_setup_implicit]
2122

2223
const express = require('express');
2324
const app = express();
2425

2526
app.enable('trust proxy');
26-
// [END setup]
2727

2828
app.get('/', (req, res) => {
2929
// Try using the StackDriver Debugger dashboard to inspect the "req" object
@@ -38,6 +38,6 @@ if (module === require.main) {
3838
console.log('Press Ctrl+C to quit.');
3939
});
4040
}
41-
// [END app]
41+
// [END debugger_app]
4242

4343
module.exports = app;

debugger/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"e2e-test": "samples test deploy"
2323
},
2424
"dependencies": {
25-
"@google-cloud/debug-agent": "2.1.0",
25+
"@google-cloud/debug-agent": "2.1.1",
2626
"express": "4.15.3"
2727
},
2828
"devDependencies": {

debugger/snippets.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Copyright 2017, Google, Inc.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
'use strict';
17+
18+
// [START debugger_setup_explicit]
19+
require('@google-cloud/debug-agent').start({
20+
projectId: 'your-project-id',
21+
keyFilename: '/path/to/key.json'
22+
});
23+
// [END debugger_setup_explicity]

debugger/yarn.lock

+4-8
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
string-format-obj "^1.1.0"
6161
through2 "^2.0.3"
6262

63-
"@google-cloud/[email protected].0":
64-
version "2.1.0"
65-
resolved "https://registry.yarnpkg.com/@google-cloud/debug-agent/-/debug-agent-2.1.0.tgz#7c0622456bde975a2b80292a07827324e857b63a"
63+
"@google-cloud/[email protected].1":
64+
version "2.1.1"
65+
resolved "https://registry.yarnpkg.com/@google-cloud/debug-agent/-/debug-agent-2.1.1.tgz#2015364bf6ac3e25f10f059b6bff8ad49106a22a"
6666
dependencies:
6767
"@google-cloud/common" "^0.13.3"
6868
acorn "^5.0.3"
@@ -2373,18 +2373,14 @@ minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4:
23732373
dependencies:
23742374
brace-expansion "^1.1.7"
23752375

2376-
2376+
[email protected], minimist@~0.0.1:
23772377
version "0.0.8"
23782378
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
23792379

23802380
minimist@^1.1.3, minimist@^1.2.0:
23812381
version "1.2.0"
23822382
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
23832383

2384-
minimist@~0.0.1:
2385-
version "0.0.10"
2386-
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
2387-
23882384
"mkdirp@>=0.5 0", mkdirp@^0.5.1:
23892385
version "0.5.1"
23902386
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"

0 commit comments

Comments
 (0)