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

Commit 61e21fb

Browse files
authored
Rename module to @google-cloud/debug-agent (#229)
1 parent 8d7bdf6 commit 61e21fb

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

README.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,27 @@ This module provides Stackdriver Debugger support for Node.js applications. [Sta
1919
## Quick Start
2020
```shell
2121
# Install with `npm` or add to your `package.json`.
22-
npm install --save @google-cloud/debug
22+
npm install --save @google-cloud/debug-agent
2323
```
2424

2525
```js
2626
// Require and start in the startup of your application:
27-
var debug = require('@google-cloud/debug')();
28-
debug.startAgent();
27+
require('@google-cloud/debug-agent').start();
2928
// No auth necessary if your code is running on Google Cloud Platform.
3029

3130
// ... or, if you are running elsewhere, you can manually provide credentials:
32-
var debug = require('@google-cloud/debug')({
31+
require('@google-cloud/debug-agent').start({
3332
projectId: 'particular-future-12345',
3433
keyFilename: '/path/to/keyfile.json'
3534
});
36-
debug.startAgent();
3735
```
3836

3937
This starts the automatic Debugger Agent that enables your app to be debuggable using the Stackdriver [Stackdriver Debug view][debug-tab] within
4038
the [Google Cloud Console][dev-console]. You can start adding snapshots and log-points to your application.
4139

4240
## Running on Google Cloud Platform
4341

44-
The Stackdriver Debugger Agent should work without manually provided authentication credentials for instances running on Google Cloud Platform, as long as the [Stackdriver Debugger API][debugger-api] access scope is enabled on that instance. For Google App Engine instances, this is automatic if the Debugger API has been enabled for your project (which it is by default).
42+
The Stackdriver Debugger Agent should work without manually provided authentication credentials for instances running on Google Cloud Platform, as long as the [Stackdriver Debugger API][debugger-api] access scope is enabled on that instance. For Google App Engine instances, this is automatic if the Debugger API has been enabled for your project (which is the default).
4543

4644
For Google Compute Engine instances, you need to explicitly enable the Debugger API access scope for each instance. When creating a new instance through the GCP web console, you can do this in one of two ways under **Identity and API access**:
4745
* Use the Compute Engine default service account and select "Allow full access to all Cloud APIs" under Access scopes.
@@ -57,16 +55,15 @@ If your application is running outside of Google Cloud Platform, such as locally
5755

5856
```JS
5957
// In your app:
60-
var debug = require('@google-cloud/debug')({
58+
var debug = require('@google-cloud/debug-agent').start({
6159
projectId: 'particular-future-12345',
6260
keyFilename: '/path/to/keyfile.json'
6361
});
64-
debug.startAgent();
6562
```
6663

6764
```BASH
6865
# Or in Bash:
69-
export GCLOUD_PROJECT=<project name>
66+
export GCLOUD_PROJECT='particular-future-12345'
7067
```
7168

7269
1. You need to provide service account credentials to your application.
@@ -79,7 +76,7 @@ If your application is running outside of Google Cloud Platform, such as locally
7976

8077
```js
8178
// Require and start the agent with configuration options
82-
require('@google-cloud/debug').start({
79+
require('@google-cloud/debug-agent').start({
8380
// The path to your key file:
8481
keyFilename: '/path/to/keyfile.json',
8582
@@ -96,15 +93,20 @@ If your application is running outside of Google Cloud Platform, such as locally
9693

9794
## Debugger Agent Settings
9895

99-
You can customize the behaviour of the automatic debugger agent. See [the agent configuration][config-js] for a list of possible configuration options. These options can be passed to the agent through the object argument to the startAgent method as shown below:
96+
You can customize the behaviour of the automatic debugger agent. See [the agent configuration][config-js] for a list of possible configuration options. These options can be passed in the `options.debug` object passed to the `start` function.
10097

10198
```JS
102-
debug.startAgent({
103-
serviceContext: {
104-
service: 'my-service',
105-
version: 'version-1'
106-
},
107-
capture: { maxFramesFrames: 20, maxProperties: 100 }
99+
require('@google-cloud/debug-agent').start({
100+
// .. auth settings ..
101+
102+
// debug agent settings:
103+
debug: {
104+
serviceContext: {
105+
service: 'my-service',
106+
version: 'version-1'
107+
},
108+
capture: { maxFrames: 20, maxProperties: 100 }
109+
}
108110
});
109111
```
110112

@@ -142,8 +144,8 @@ As soon as that line of code is reached in any of the running instances of your
142144
[service-account]: https://console.cloud.google.com/apis/credentials/serviceaccountkey
143145
[service-account-docs]: https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances
144146
[debugger-roles]: https://cloud.google.com/debugger/docs/iam#roles
145-
[npm-image]: https://img.shields.io/npm/v/@google-cloud/debug.svg
146-
[npm-url]: https://npmjs.org/package/@google-cloud/debug
147+
[npm-image]: https://img.shields.io/npm/v/@google-cloud/debug-agent.svg
148+
[npm-url]: https://npmjs.org/package/@google-cloud/debug-agent
147149
[travis-image]: https://travis-ci.org/GoogleCloudPlatform/cloud-debug-nodejs.svg?branch=master
148150
[travis-url]: https://travis-ci.org/GoogleCloudPlatform/cloud-debug-nodejs
149151
[coveralls-image]: https://img.shields.io/coveralls/GoogleCloudPlatform/cloud-debug-nodejs/master.svg

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "@google-cloud/debug",
2+
"name": "@google-cloud/debug-agent",
33
"version": "0.10.0",
44
"author": "Google Inc.",
55
"description": "Stackdriver Debug Agent for Node.js",
66
"main": "./src/index.js",
7-
"repository": "googlecloudplatform/google-cloud-node",
7+
"repository": "googlecloudplatform/cloud-debug-nodejs",
88
"keywords": [
99
"google",
1010
"debugger",

0 commit comments

Comments
 (0)