1+ [ // ] : # " This README.md file is auto-generated, all changes to this file will be lost. "
2+ [ // ] : # " To regenerate it, use `npm run generate-scaffolding`. "
13<img src =" https://avatars2.githubusercontent.com/u/2810941?v=3&s=96 " alt =" Google Cloud Platform logo " title =" Google Cloud Platform " align =" right " height =" 96 " width =" 96 " />
24
35# Stackdriver Monitoring: Node.js Samples
1012
1113* [ Before you begin] ( #before-you-begin )
1214* [ Samples] ( #samples )
15+ * [ Alert Policies] ( #alert-policies )
1316 * [ Metrics] ( #metrics )
1417 * [ Uptime Config] ( #uptime-config )
1518
@@ -21,9 +24,56 @@ library's README.
2124
2225## Samples
2326
27+ ### Alert Policies
28+
29+ View the [ source code] [ alerts_0_code ] .
30+
31+ [ ![ Open in Cloud Shell] [ shell_img ]] ( https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring&page=editor&open_in_editor=samples/alerts.js,samples/README.md )
32+
33+ __ Usage:__ ` node alerts.js --help `
34+
35+ ```
36+ alerts.js <command>
37+
38+ Commands:
39+ alerts.js backup <projectId> Save alert policies to a ./policies_backup.json file.
40+ alerts.js restore <projectId> Restore alert policies from a ./policies_backup.json file.
41+ alerts.js replace <alertPolicyName> <channelNames..> Replace the notification channels of the specified alert policy.
42+ alerts.js disable <projectId> [filter] Disables policies that match the given filter.
43+ alerts.js enable <projectId> [filter] Enables policies that match the given filter.
44+
45+ Options:
46+ --version Show version number [boolean]
47+ --alertPolicyName [string]
48+ --help Show help [boolean]
49+
50+ Examples:
51+ node alerts.js backup my-project-id Backup policies.
52+ node alerts.js restore my-project-id Restore policies.
53+ node alerts.js replace Replace the notification channels of the specified alert
54+ projects/my-project-id/alertPolicies/12345 channel-1 policy.
55+ channel-2 channel-3
56+ node alerts.js disable my-project-id "(NOT Disables policies that match the given filter.
57+ display_name.empty OR NOT description.empty) AND
58+ user_labels='active'"
59+ node alerts.js disable my-project-id "description:'cloud'" Disables policies that match the given filter.
60+ node alerts.js disable my-project-id Disables policies that match the given filter.
61+ "display_name=monitoring.regex.full_match('Temp \d{4}')"
62+ node alerts.js enable my-project-id "(NOT display_name.empty Enables policies that match the given filter.
63+ OR NOT description.empty) AND user_labels='active'"
64+ node alerts.js enable my-project-id "description:'cloud'" Enables policies that match the given filter.
65+ node alerts.js enable my-project-id Enables policies that match the given filter.
66+ "display_name=monitoring.regex.full_match('Temp \d{4}')"
67+
68+ For more information, see https://cloud.google.com/monitoring/docs/
69+ ```
70+
71+ [ alerts_0_docs ] : https://cloud.google.com/monitoring/docs
72+ [ alerts_0_code ] : alerts.js
73+
2474### Metrics
2575
26- View the [ source code] [ metrics_0_code ] .
76+ View the [ source code] [ metrics_1_code ] .
2777
2878[ ![ Open in Cloud Shell] [ shell_img ]] ( https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring&page=editor&open_in_editor=samples/metrics.js,samples/README.md )
2979
@@ -52,7 +102,7 @@ Commands:
52102
53103Options:
54104 --version Show version number [boolean]
55- --projectId, -p [string]
105+ --projectId, -p [string] [default: "nodejs-docs-samples" ]
56106 --help Show help [boolean]
57107
58108Examples:
@@ -71,12 +121,12 @@ Examples:
71121For more information, see https://cloud.google.com/monitoring/docs
72122```
73123
74- [ metrics_0_docs ] : https://cloud.google.com/monitoring/docs
75- [ metrics_0_code ] : metrics.js
124+ [ metrics_1_docs ] : https://cloud.google.com/monitoring/docs
125+ [ metrics_1_code ] : metrics.js
76126
77127### Uptime Config
78128
79- View the [ source code] [ uptime_1_code ] .
129+ View the [ source code] [ uptime_2_code ] .
80130
81131[ ![ Open in Cloud Shell] [ shell_img ]] ( https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring&page=editor&open_in_editor=samples/uptime.js,samples/README.md )
82132
@@ -86,19 +136,19 @@ __Usage:__ `node uptime.js --help`
86136uptime.js <command>
87137
88138Commands:
89- uptime.js create <gceInstanceId > [projectId] Creates an uptime check config.
139+ uptime.js create <hostname > [projectId] Creates an uptime check config.
90140 uptime.js list [projectId] Lists uptime check configs.
91141 uptime.js list-ips Lists uptime check config IPs.
92142 uptime.js get <uptimeCheckConfigId> [projectId] Gets an uptime check config.
93143 uptime.js delete <uptimeCheckConfigId> [projectId] Deletes an uptime check config.
94144
95145Options:
96146 --version Show version number [boolean]
97- --projectId, -p [string]
147+ --projectId, -p [string] [default: "nodejs-docs-samples" ]
98148 --help Show help [boolean]
99149
100150Examples:
101- node uptime.js create my-instance Create an uptime check for a "my-instance" GCE instance .
151+ node uptime.js create mydomain.com Create an uptime check.
102152 node uptime.js list List all uptime check configs.
103153 node uptime.js list "resource.type = gce_instance AND List all uptime check configs for a specific GCE
104154 resource.label.instance_id = mongodb" instance.
@@ -109,8 +159,8 @@ Examples:
109159For more information, see https://cloud.google.com/monitoring/uptime-checks/
110160```
111161
112- [ uptime_1_docs ] : https://cloud.google.com/monitoring/docs
113- [ uptime_1_code ] : uptime.js
162+ [ uptime_2_docs ] : https://cloud.google.com/monitoring/docs
163+ [ uptime_2_code ] : uptime.js
114164
115- [ shell_img ] : //gstatic.com/cloudssh/images/open-btn.png
165+ [ shell_img ] : https: //gstatic.com/cloudssh/images/open-btn.png
116166[ shell_link ] : https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-monitoring&page=editor&open_in_editor=samples/README.md
0 commit comments