I have a Google project where I execute and log from an Apps Script. I created a log monitoring policy to be notified if `severity>=ERROR` and in the preview during policy creation the filter lists the appropriate log entries I'd like to alert on. I also set the time interval to 5 minutes and auto resolution to 1 hour. When a generate an error from the script a new error log entry in created but when I view the alerting summary page there are no alerts listed.
I get the same behavior when I create an error notification from the error reporting summary. I configure a notification with an email notification channel with my email. I resolve all errors listed and then generate the error again from the Apps Script. The new error is reported but no email notification is sent.
I've followed the trouble shooting tips from the built in Genie which includes:
1. Policy Configuration Issues:
2. Notification Channel Problems:
3. Log-Based Alerting Issues:
4. Personalized Service Health:
5. App Engine Logs:
Troubleshooting Steps:
I'm assuming that because I can create a policy I have the right permissions in place. Any help would be appreciated!
Hello @charles9876 ,Welcome on Google Cloud Community.
Would you be able to provide screenshots of your alerting policy configuration along with log-based metric config ?
--
cheers,
Damian Sztankowski
LinkedIn medium.com Cloudskillsboost Sessionize Youtube
Here's the json for the policy:
{
"name": "projects/XXXXfoods/alertPolicies/748579912096065859",
"displayName": "Apps Script Exception Error",
"documentation": {
"content": "XXXX Foods Error",
"mimeType": "text/markdown"
},
"userLabels": {},
"conditions": [
{
"name": "projects/XXXXfoods/alertPolicies/748579912096065859/conditions/748579912096063760",
"displayName": "Log match condition",
"conditionMatchedLog": {
"filter": "severity>=ERROR",
"labelExtractors": {
"XXXXFoods": "EXTRACT(jsonPayload.message)"
}
}
}
],
"alertStrategy": {
"notificationRateLimit": {
"period": "3600s"
},
"autoClose": "3600s",
"notificationPrompts": [
"OPENED"
]
},
"combiner": "OR",
"enabled": true,
"notificationChannels": [
"projects/XXXXfoods/notificationChannels/16995925881456324820"
],
"creationRecord": {
"mutateTime": "2024-12-09T14:36:40.638419280Z",
"mutatedBy": "XXXXfoods@XXXXXXX.com"
},
"mutationRecord": {
"mutateTime": "2024-12-11T13:39:16.768479184Z",
"mutatedBy": "XXXXfoods@XXXXXXX.com"
},
"severity": "ERROR"
}
I've obfuscated some of the data with `XXXX` and here are a couple screen shot of the policy
Thanks for taking a look at this!