Create Alerts
Contents
Create Alerts#
GCP allows for the creation of alerts based on specified log-based criteria, but it is not obvious how this can be done.
The process consists of 4 main steps:
Test the created alert
Create Logs-based Metric#
Click on
CREATE METRIC
under User-defined metricsProvide the requested information
Metric Type:
Counter
Details
Log metric name:
<name>
Description:
<desciption>
Units:
1
Filter selection:
<log-based query criteria>
Labels: Ignore
Click
CREATE METRIC
Create Alerting Policy#
Click on
Create Policy
at the menu barClick
SELECT A METRIC
Disable
Show only active resources & metrics
Search for and select
logging/user/<log_metric_name_configured_above>
Provided the requested information:
Transform data
Rolling window:
1 min
Rolling window function:
count
Click on
Next
Provide the requested information
Condition type:
Threshold
Alert trigger:
Any time series violates
Threshold position:
Above threshold
Threshold value:
0.99
Click on
Next
Select previously configured notification channel and preferred incident autoclose duration
Give the alert a name
Click on
Next
Click on
CREATE POLICY