Prepare and test your skills
Prepare and test your skills
Customizing alert payloads and troubleshooting delivery failures is the practice of adding actionable context to notifications and tracing failed deliveries from source to receiver. Cloud Monitoring (opens in a new tab) evaluates log or metric data from Cloud Logging and Cloud Monitoring, then sends a payload through a notification channel to email, Slack, PagerDuty, SMS, Pub/Sub, or a webhook. When delivery fails, diagnosis follows the same path in reverse, from the receiver back through the channel, the alert policy, and the originating log.
Enriching an alert payload means ensuring the notification carries the facts a responder needs to triage without opening multiple consoles. A complete notification typically carries the same core context:
Cloud Monitoring alert policies are the mechanism within Google Cloud Observability that delivers these notifications to a team. For network telemetry, Cloud Network Insights (opens in a new tab) uses log-based alerting where an alarm writes a structured log entry named networkmanagement.googleapis.com/insights_alarm to Cloud Logging, and the alert policy fires from that log. Predefined alert policy templates simplify configuration for common scenarios such as a Critical Network Alarm, and each policy connects to existing notification channels to deliver the enriched payload by email, Slack, PagerDuty, SMS, or Pub/Sub.
Alert data flows from the monitored system to the third-party incident platform through an ordered chain where each step depends on the previous step:
networkmanagement.googleapis.com/insights_alarm, while a structural change such as a Monitoring Point going offline and online again or a network route change writes networkmanagement.googleapis.com/insights_event.Ingestion on the receiving side depends on correct ownership of contacts and visibility. An incident response group email is configured for the Security or All category in Essential Contacts, and security administrators are granted the Advisory Notifications Viewer role (roles/advisorynotifications.viewer) so advisories are visible in the Google Cloud console.
Exam tip: Alarm rules that define thresholds are created in AppNeta, while notification policies that send email, Slack, PagerDuty, or Pub/Sub notifications are configured in the Google Cloud console.
Troubleshooting delivery failures means isolating whether the break is in log generation, policy evaluation, channel configuration, or the network path to the receiver. Cloud Logging audit logs provide the diagnostic record for what was written, what was evaluated, and what access or configuration change may have blocked delivery. Diagnosis must check each dependency in order because Cloud Monitoring depends on Cloud Logging for the trigger and the third-party platform depends on the notification channel for the payload.
insights_alarm or insights_event entry reached Cloud Logging and whether calls such as SetIamPolicy changed who can view or manage alerts.When the path crosses a trust boundary from Google Cloud to a third-party receiver, the channel depends on firewall, routing, and authentication remaining open. Fixing the upstream log or the downstream path alone does not restore delivery until both sides succeed in order.
Integrating native incident response platforms automates alert response by sending Monitoring incidents directly to an external on-call service. Cloud Monitoring (opens in a new tab) moves data from a Cloud Monitoring alerting policy to a PagerDuty notification channel to a PagerDuty service, where the event creates a PagerDuty alert that follows that service's escalation policy. This design keeps detection in Google Cloud while ownership for paging, escalation, and resolution tracking lives in the external platform for high-availability operations.
The native PagerDuty notification channel connects Cloud Monitoring to a PagerDuty service through the PagerDuty Events API v1 integration. The operator first creates the endpoint in PagerDuty and copies the integration key, then creates the channel in Google Cloud, and only after the channel is saved can alerting policies select PagerDuty in the Notifications section. The channel is therefore a dependency for every policy that pages PagerDuty.
Events API v1 integration to a new or existing PagerDuty service from the Service Directory and copy the integration key.The integration key is the trust link between the two systems because possession of the key authorizes Cloud Monitoring to post events into that specific PagerDuty service. Keeping the Display Name aligned with the PagerDuty service name preserves clear ownership when many services and channels exist, including App Hub configurations where the channel is managed in the App Hub host project or management project.
The PagerDuty payload carries the full Monitoring incident context needed for automated incident creation and lifecycle synchronization. Cloud Monitoring sends a JSON packet with a description string and a details object that uses schema version 1.2, and the alerting backend attempts to generate that version by default. Data flows from the Monitoring alerting backend to the PagerDuty service endpoint, where an opened Monitoring incident triggers a PagerDuty alert and a later resolved or closed Monitoring incident updates that external alert with end time and state.
The details.incident object identifies both sides of the relationship:
incident_id, scoping_project_id, scoping_project_number, and url link the PagerDuty alert back to the originating Monitoring incident in the Google Cloud console.started_at, ended_at, state, and renotify describe when the incident started, when it ended, and whether it is still active or closed.resource, resource_id, resource_name, resource_display_name, resource_type_display_name, metric, and metadata describe the monitored resource type such as gce_instance, its labels, the metric type such as compute.googleapis.com/instance/cpu/utilization, and system and user labels.policy_name, policy_user_labels, documentation, condition, condition_name, severity, threshold_value, and observed_value identify the alerting policy and condition that opened or resolved the incident and the value that crossed the threshold.The payload schema is subject to the Google Cloud deprecation policy, but the formats of generated field values can change without notice. Consume values such as incident.summary, incident.documentation.content, and incident.url as a whole and do not rely on parsing inside those generated strings, because the schema guarantees the field exists but not its internal text format.
Severity mapping aligns the Monitoring incident severity with the PagerDuty alert severity that drives escalation policies. By default, PagerDuty notifications show all Monitoring severity levels as critical, so without extra configuration a low-severity warning and a critical outage escalate the same way. The Monitoring incident.severity field carries the policy severity, and if no severity was defined during alerting policy creation, Cloud Monitoring sets the value to no severity.
To preserve the intended urgency, configure event orchestration rules in PagerDuty that read event.custom_details.incident.severity and set the corresponding PagerDuty alert severity before escalation runs:
event.custom_details.incident.severity matches part 'VALUE', where VALUE is one Monitoring severity value, then continue.no severity.Exam tip: PagerDuty defaults every Monitoring incident to critical; only an orchestration rule matching on event.custom_details.incident.severity restores the original Monitoring severity for escalation.
A custom webhook notification channel in Cloud Monitoring (opens in a new tab) is a delivery target that posts alert data as an HTTP request to any public endpoint you control. An alerting policy or log-based alert evaluates a condition, opens a Monitoring incident, and then Cloud Monitoring sends a notification through the channel to a third-party incident platform such as PagerDuty, ServiceNow, DataDog, OpsGenie, or Rootly. Use webhooks when no built-in integration exists for the destination and you need automated alert response outside Google Cloud.
The webhook channel sits at the end of the alerting flow in Cloud Monitoring. Data flows from the monitored source to the alerting policy, from the policy to an incident, and from the incident to each configured notification channel, including the webhook. The webhook then posts the payload from Cloud Monitoring to the external public endpoint, where the third-party tool creates or updates its own ticket, page, or event.
Each notification carries context for troubleshooting and links back to Google Cloud. A notification includes relevant failure details and a link to its incident, and an incident is a persistent record that stores status, links to logs, a chart of recorded metric data, labels, and duration. For Personalized Service Health log alerts, each notification is also associated with a Monitoring incident and includes a link to the incident page and a direct link to the Service Health dashboard. Cloud Monitoring creates and manages alerting policies through the Google Cloud console, the Cloud Monitoring API, the Google Cloud CLI, or Terraform, but alert delivery depends on the notification channel existing before it is selected in a policy.
Log alerts and metric alerts in Cloud Monitoring use notification channels to reach people or on-call teams when a policy triggers. The supported channels form a set of peer delivery options:
The choice of channel defines a trust and network boundary. Webhooks send to public endpoints over the internet, while Pub/Sub sends to private endpoints that do not need public exposure. Native PagerDuty and Slack channels use their built-in Cloud Monitoring integrations, with email sent from alerting-noreply@google.com and Slack messages posted by the Cloud Monitoring application.
| Destination | Endpoint type | Choose when |
|---|---|---|
| Webhook | Any public HTTPS endpoint | The target is ServiceNow, DataDog, OpsGenie, Rootly, or another custom tool with no native channel |
| Pub/Sub | Private endpoint via topic subscription | The receiver must stay private and pull messages without exposing a public URL |
| Native PagerDuty or Slack | Vendor integration managed by Cloud Monitoring | The workflow fits standard paging or chat notification without custom payload routing |
Exam tip: Choose a webhook to reach any public endpoint or custom tool, and choose Pub/Sub when the receiver must remain a private endpoint.
Configuration of an alert that notifies a webhook requires a channel first and a policy second. The principal creating the policy must hold the Monitoring Editor (roles/monitoring.editor) IAM role on the Google Cloud project. Only after the webhook channel exists can it be selected during policy creation, and channel creation itself depends on Identity and Access Management (IAM) permission to manage monitoring configuration.
A metric-based alerting policy for Application Integration (opens in a new tab) or Integration Connectors (opens in a new tab) follows an ordered workflow:
Integration Version or Connectors, then select the metric type and Active Metrics and click Apply.A log-based alert follows a parallel path through Cloud Logging. The policy defines an inclusion filter written in the Logging query language that determines which ingested logs fire the alert, such as maintenance events, failed integration executions, or severity-matched messages. Data flows from Logs Explorer or the Monitoring API into the alerting policy, and the policy can extract labels from log fields for third-party routing, set minimum Time between notifications, and set Incident autoclose duration before the notification channels are attached. Alerts are subject to Cloud Monitoring limits, for example 20 alerts per policy per day per project, and essential contacts configured on the project also receive alert copies.
Securing a webhook notification channel in Cloud Monitoring means controlling who can create the channel, what data leaves the project, and which endpoint can receive it. Channel management depends on IAM, so only identities with Monitoring Editor or equivalent permission can create, list, or attach webhook channels through the console, API, CLI, or Terraform. This boundary keeps control of external delivery on the Google Cloud side, while authentication and verification of the incoming POST remain the responsibility of the public endpoint owner.
Control over payload content comes from filters, documentation, and labels. Logging filters decide which logs are sent to third-party tools, so a narrow inclusion filter limits exposure to only matching events such as SCHEDULED maintenance for a specific resource type or location. The Documentation field and extracted log labels further define what context travels with the webhook, which lets the receiver route and verify the event without receiving unrelated project data. For planned maintenance, this means separate policies can fire when a new event is scheduled, when state changes from SCHEDULED to STARTED, when start or end time changes, or when a specific location is impacted.
event.custom_details.incident.severity to restore the original severity.Use a webhook notification channel in Cloud Monitoring when the destination is a custom tool such as ServiceNow, DataDog, OpsGenie, or Rootly with no native channel and you can receive posts at any public HTTPS endpoint. Use Pub/Sub when the receiver must stay private and pull messages without public exposure, and use native PagerDuty or Slack channels when the workflow fits standard paging or chat notification without custom routing.
First add an Events API v1 integration to the PagerDuty service and copy the integration key, then create a PagerDuty notification channel in Monitoring Alerting with the Display Name matching the PagerDuty service and the integration key pasted into the Service Key field. Only after the channel is saved can alerting policies select PagerDuty in the Notifications section.
By default PagerDuty notifications show all Cloud Monitoring severity levels as critical, so a low-severity warning and a critical outage escalate the same way. To restore the original urgency, configure event orchestration rules in PagerDuty that read event.custom_details.incident.severity and set the corresponding PagerDuty alert severity before escalation runs.
Your DevOps engineering team is integrating Google Cloud Monitoring alerting policies with an external incident response webhook service. The operations team requires that all triggered incident notifications include rich context, specifically a formatted Markdown runbook link and dynamically resolved runtime metadata (such as the target project ID, affected compute zone, and triggering metric threshold).
Additionally, several test alert notifications fail to reach the external incident management webhook endpoint, and you must identify the root cause of the delivery dropouts.
Which configuration and troubleshooting approach should you implement?
Configure an Eventarc trigger routed to Workflows that intercepts metric violations, reformats raw JSON logs into HTML templates, and parses VPC Flow Logs to diagnose external webhook connection drops.
Define the alert policy documentation field using Markdown formatting and dynamic variable substitutions ${resource.labels.zone} and ${project_id}. Query Cloud Logging using Logs Explorer filtering on the notification_channel monitored resource type to inspect delivery error codes, timeouts, and connection failure logs.
Inject custom bash scripts into the alert policy user labels to query Cloud Resource Manager via API, and configure Cloud Trace to capture external HTTP postback latency.
Embed Jinja2 templating syntax into the alert policy condition filter to render HTML tables, and review Cloud Profiler traces to identify remote webhook latency and delivery timeouts.
Last updated