This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
.readme-partials.yaml
92 lines (74 loc) · 4.02 KB
/
.readme-partials.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
introduction: |-
> This module provides Snapshot Debugger support for Node.js applications.
Snapshot Debugger is an open source product that lets you debug your
applications in production without stopping or pausing your application.
A Firebase Realtime Database instance is used to store your data.
## Project Status: Archived
This project has been archived and is no longer supported. There will be no
further bug fixes or security patches. The repository can be forked by users
if they want to maintain it going forward.
body: |-
## Debugger Agent Settings
To customize the behaviour of the automatic debugger agent, specify options
when starting the agent. The following code sample shows how to pass in a
subset of the available options.
```js
require('@google-cloud/debug-agent').start({
// .. auth settings ..
// debug agent settings:
allowExpressions: true,
serviceContext: {
service: 'my-service',
version: 'version-1'
},
capture: { maxFrames: 20, maxProperties: 100 }
});
```
The following options configure the connection to the Firebase database:
* firebaseDbUrl - https://**PROJECT_ID**-cdbg.firebaseio.com will be used if
not provided. where **PROJECT_ID** is your project ID.
* firebaseKeyPath - Default google application credentials are used if not
provided.
Some key configuration options are:
* allowExpressions - Whether or not it is permitted to evaluate
epressions. Functionality is limited when this is not set, but there
is some risk that malicious expressions can mutate program state.
* serviceContext - This information is utilized in the UI to identify all
the running instances of your service. Set this if you do not like the
default values.
* capture - Configuration options on what is captured on a snapshot. Set
this if the default snapshot captures are too limited. Note that
relaxing constraints may cause performance impact.
See [the agent configuration][config-ts] for a list of possible configuration
options.
## Using the Debugger
Once your application is running, use the
[Snapshot Debugger CLI](https://pypi.org/project/snapshot-dbg-cli/) or the
[VSCode extension][extension-page]
to debug your application.
## Historical note
Version 6.x and 7.x of this agent supported both the now shutdown Cloud
Debugger service (by default) and the
[Snapshot Debugger](https://github.com/GoogleCloudPlatform/snapshot-debugger/)
(Firebase RTDB backend) by setting the `useFirebase` flag to true. Version 8.0.0
removed support for the Cloud Debugger service, making the Snapshot Debugger the
default. To note the `useFirebase` flag is now obsolete, but still present for
backward compatibility.
## Limitations and Requirements
> Note: There is a known issue where enabling the agent may trigger memory
leaks. See [#811](https://github.com/googleapis/cloud-debug-nodejs/issues/811)
* Privacy issues can be created by setting snapshot conditions that watch
expressions evaluated in the context of your application. You may be able
to view sensitive user data when viewing the values of variables.
* The debug agent tries to ensure that all conditions and watchpoints you
add are read-only and have no side effects. It catches, and disallows,
all expressions that may have static side effects to prevent accidental
state change. However, it presently does not catch expressions that have
dynamic side-effects. For example, `o.f` looks like a property access,
but dynamically, it may end up calling a getter function. We presently do
NOT detect such dynamic-side effects.
* The root directory of your application needs to contain a `package.json`
file.
[config-ts]: https://github.com/googleapis/cloud-debug-nodejs/blob/main/src/agent/config.ts
[extension-page]: https://github.com/GoogleCloudPlatform/snapshot-debugger/tree/main/snapshot_dbg_extension
[snapshot-debugger-readme]: https://github.com/GoogleCloudPlatform/snapshot-debugger#readme