Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit 7166534

Browse files
Add a configuration section to the README (#170)
This PR adds a configuration section to the README file that should have been added in PR #167.
1 parent cd1f579 commit 7166534

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ This module provides Stackdriver Debugger support for Node.js applications. [Sta
2020
# Install with `npm` or add to your `package.json`.
2121
npm install --save @google/cloud-debug
2222

23-
# Require the agent at the top of your main script (but after '@google/cloud-trace' if you are also using it).
24-
require('@google/cloud-debug');
23+
# Require and start the agent at the top of your main script (but after '@google/cloud-trace' if you are also using it).
24+
require('@google/cloud-debug').start();
2525
```
2626
Deploy your application, and navigate to the [Stackdriver Debug view][debug-tab] within the [Google Cloud Console][dev-console] to set snapshots and start debugging.
2727

@@ -65,6 +65,18 @@ If your application is running outside of Google Cloud Platform, such as locally
6565

6666
gcloud app gen-repo-info-file
6767

68+
## Configuration
69+
70+
See [the default configuration](config.js) for a list of possible configuration options. These options can be passed to the agent through the object argument to the start command as shown below:
71+
72+
require('@google/cloud-debug').start({
73+
logLevel: 2,
74+
serviceContext: {
75+
service: 'my-service',
76+
version: '1'
77+
}
78+
});
79+
6880
## Using the Debugger
6981

7082
Once your application is running (deployed, or elsewhere), you should be able to use the [Debug UI][debug-tab] in your Cloud [developer console][dev-console]. You can find the Debug UI in the 'STACKDRIVER -> Debug' section in the navigation panel, or by simply searching for 'Debug' in the cloud console.

config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ module.exports = {
2424
// An identifier for the current code deployment.
2525
description: undefined,
2626

27+
serviceContext: {
28+
// An identifier for the deployed application's service name
29+
service: undefined,
30+
31+
// An identifier for the deployed application's version
32+
version: undefined
33+
},
34+
2735
// The path within your repository to the directory containing the
2836
// package.json for your deployed application. This should be provided
2937
// if your deployed application appears as a subdirectory of your repository.

0 commit comments

Comments
 (0)