![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
gcmetrics
Advanced tools
Readme
This is a command line for interactive with google cloud platform - cloud monitoring api.
npm install gcmetric -g
In the auth flow, it needs service account for implement Oauth2.0 authentication. Here, we need to prepare the account email and the pem key for auth. And the project id also need to specify in the auth command.
gcmetric -t auth \
-s 288173501788-9fh14iojjmehakjtgkhoubdiaguppn1h@developer.gserviceaccount.com \
-k /Users/peihsinsu/.gcpkeys/mitac-cp300-taipei101/mitac-cp300-taipei101-8c0662095ef9.pem \
-p mitac-cp300-taipei101
In the command, the parameters are:
gcmetric -t init -n mymetric
gcmetric -t simple -n mymetric -d 2000
gcmetric -t init -n mymetric2 -i firstid -d "test first id"
gcmetric -t labeled -n mymetric2 -d 1234
You can create a multiple metric descriptor into a custom metric:
gcmetric -t init -n mymetric3 -j '[{
"key": "custom.cloudmonitoring.googleapis.com/id1",
"description": "This is ID1."
},{
"key": "custom.cloudmonitoring.googleapis.com/id2" ,
"description": "This is ID2."
}]'
In this case, you can write the id1 and id2 type of data into the metric: mymetric3.
Write data with specify the metric descriptor.
gcmetric -t labeled \
-j '{"custom.cloudmonitoring.googleapis.com/id2":"id222"}' \
-n mymetric3 \
-d 1230
You can also write your custom json data as input to cloud monitoring.
gcmetric -t custw \
-j '{
"timeseries":[
{
"timeseriesDesc":{
"project":"mitac-cp300-taipei101",
"metric":"custom.cloudmonitoring.googleapis.com/mymetric3",
"labels":{
"custom.cloudmonitoring.googleapis.com/id2":"id222"
}
},
"point":{
"start":"2015-06-23T11:31:23.781Z",
"end":"2015-06-23T11:31:23.781Z",
"doubleValue":"1230"
}
}
]
}'
In the write customize metric data sample, you can write more timeseries in the array in one request. It helps for the performance.
You can also delete the metric by using delete like:
gcmetric -t delete -p mitac-cp300-taipei101 -n mymetric
For some reason, you may need to retrieve the metric data from the project. You can use the following sample for retrieve the data from command line.
gcmetric -t get -p mitac-cp300-taipei101 -n mymetric
You can also specify the youngest and oldest in the option json data for restrict the interval.
gcmetric -t get -p mitac-cp300-taipei101 -n mymetric -d '{"youngest":"2015-6-22 23:18","oldest":"2015-6-22 23:15"}'
gcmetric -h
Usage: gcmetric [options]
Options:
-h, --help output usage information
-V, --version output the version number
-p, --project <project> google cloud platform project id
-s, --service_account <service_account> service account email
-k, --key <key> service account pem key
-t, --type <type> auth | init | simple | labeled
-n, --name <name> metric name
-i, --id <id> metrics id
-d, --data <data> metrics data value
-j, --jsondata <jsondata> metrics original json data
-l, --loglevel <loglevel> log level
FAQs
Google Cloud Custom Metric command tool
The npm package gcmetrics receives a total of 0 weekly downloads. As such, gcmetrics popularity was classified as not popular.
We found that gcmetrics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.