In Flashduty On-call
Get an integration push URL in either of the two ways below. Choose the Google Cloud Monitoring integration type in both, not Personalized Service Health.
Use a dedicated integration
- In the Flashduty console, go to Channels and open a channel
- Go to Settings → Integrations → Dedicated integrations and click Add an integration
- Select Google Cloud Monitoring and click Save
- Open the generated integration card and copy the Push URL, in the form
https://api.flashcat.cloud/event/push/alert/google-cm?integration_key=<integration key>
Use a shared integration
- In the Flashduty console, go to Integration Center → Alert Events
- Select Google Cloud Monitoring and enter an integration name
- Configure the default route and select a channel; you can add more rules under Routes after creation
- Click Save and copy the generated Push URL
Configure in Google Cloud
Step 1: Prepare
- Enable the Service Health API in the project you want to receive events for, and make sure billing is enabled for it
- The account that configures alerts needs these IAM roles on the project: Logs Configuration Writer (
roles/logging.configWriter), Monitoring AlertPolicy Editor (roles/monitoring.alertPolicyEditor), Monitoring NotificationChannel Viewer (roles/monitoring.notificationChannelViewer) and Personalized Service Health Viewer (roles/servicehealth.viewer)
Step 2: Create a webhook notification channel
- In the Google Cloud console, go to Monitoring → Alerting and click Edit notification channels
- In the Webhook section, click Add New, enter the push URL copied above as the
Endpoint URL, and enterFlashdutyas theDisplay Name - Click Test Connection, then click Save
Step 3: Create a Service Health alerting policy
Use either method. Method 1: In the Service Health dashboard- Open the Service Health dashboard and click Create Alert Policy at the upper right
- Choose an alerting policy template, select the webhook channel from Step 2 as the notification channel, and click Create Policies
- To change the condition, choose Customize alert policy in the template’s menu
policy.json. NOTIFICATION_CHANNEL is the resource name of the channel from Step 2, in the form projects/PROJECT_ID/notificationChannels/885798905074 (list them with gcloud beta monitoring channels list):
filter is the log filter. Common conditions from the Google documentation:
Product IDs and location names are listed in the Google documentation Google Cloud products and locations. Set the Policy severity level (API field
severity) in the alerting policy; Flashduty uses it for the alert severity.
Step 4: Test
Following the Google documentation, write a test log entry to Cloud Logging, wait a few minutes, and confirm the alert in Monitoring → Incidents and in Flashduty. Wait at least 5 minutes before testing again.LOG_NAME; the Google documentation uses the format projects/PROJECT_ID/logs/servicehealth.googleapis.com%2Factivity.
Enable the auto-resolve timeout
For log-based alerting policies, Cloud Monitoring only sends a notification when an incident opens, not when it closes (the API documents the notification prompt of log-based policies as always
OPENED), so Flashduty receives no recovery notification. Enable the auto-resolve timeout on the channel that receives these alerts, choose Incident trigger as the window timing start, and start with 24 hours, adjusted to the usual duration of the events you care about.
The autoClose setting in the alerting policy only decides when the incident closes in Cloud Monitoring (7 days by default for log-based alerts); it does not notify Flashduty.
Field mapping
Troubleshooting
- No alert arrives: confirm in Monitoring → Incidents that the incident opened; check whether the log filter matches, and note that notifications are rate limited (the Google documentation gives 20 alerts per policy per day per project as an example)
- The alert does not recover: log-based alerts send no closure notification, so enable the channel’s auto-resolve timeout
- Test Connection fails: confirm the
Endpoint URLis the full push URL, includingintegration_key - Several updates of one event produce several alerts: each Cloud Monitoring incident (
incident_id) maps to one Flashduty alert; using thenew_eventcondition notifies only for new events and reduces the number of alerts