-
-
Save palladius/5c109015324fc6bffbfce2f58525760f to your computer and use it in GitHub Desktop.
Sample JSON policy: it alerts me when my Macbook battery life is below 20%
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "projects/ric-cccwiki/alertPolicies/4142185058226000775", | |
| "displayName": "Macbook at home K40 needs charger", | |
| "documentation": { | |
| "content": "Your Macbook Battery at home is below 50%. Mattley, fa qualcosa!", | |
| "mimeType": "text/markdown" | |
| }, | |
| "userLabels": { | |
| "env": "prod", | |
| "scope": "personal", | |
| "reason": "macbook-needs-charger" | |
| }, | |
| "conditions": [ | |
| { | |
| "name": "projects/ric-cccwiki/alertPolicies/4142185058226000775/conditions/6329688841835481336", | |
| "displayName": "Riccardo Macbook Battery - custom/BatteryLife", | |
| "conditionThreshold": { | |
| "aggregations": [ | |
| { | |
| "alignmentPeriod": "300s", | |
| "perSeriesAligner": "ALIGN_MEAN" | |
| } | |
| ], | |
| "comparison": "COMPARISON_LT", | |
| "duration": "0s", | |
| "filter": "resource.type = \"gce_instance\" AND resource.labels.instance_id = \"ricc-macbookpro3\" AND metric.type = \"custom.googleapis.com/BatteryLife\"", | |
| "thresholdValue": 40, | |
| "trigger": { | |
| "count": 1 | |
| } | |
| } | |
| } | |
| ], | |
| "alertStrategy": { | |
| "autoClose": "604800s" | |
| }, | |
| "combiner": "OR", | |
| "enabled": true, | |
| "notificationChannels": [ | |
| "projects/ric-cccwiki/notificationChannels/11244395096800566643", | |
| "projects/ric-cccwiki/notificationChannels/13099078121529356635", | |
| "projects/ric-cccwiki/notificationChannels/16791546489941562055" | |
| ], | |
| "creationRecord": { | |
| "mutateTime": "2022-11-10T04:55:42.517981702Z", | |
| "mutatedBy": "my-private-email@gmail.com" | |
| }, | |
| "mutationRecord": { | |
| "mutateTime": "2022-11-12T17:31:36.396408365Z", | |
| "mutatedBy": "my-private-email@gmail.com" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment