This document describes how to manage your uptime checks by using the Google Cloud console, the Google Cloud CLI, the Cloud Monitoring API, and the client libraries.
List all uptime checks
Console
-
In the Google Cloud console, go to the Uptime checks page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
The following example shows a sample Uptime checks page:
(Optional) To restrict the uptime checks that are listed, add filters.
Each filter is composed of a name and a value. You can set the value to be an exact match for an uptime check name, or a partial match. Matches aren't case sensitive. For example, to list all uptime checks whose name contains
default
, do the following:- Click Filter table and select Display name.
- Enter
default
and then press the return key.
If you have multiple filters, then the filters are automatically joined by a logical
AND
unless you insert anOR
filter. The previous example uses theOR
filter so that an uptime check is listed if its name matchesdefault
orTesting check
.
gcloud
To list your uptime checks and synthetic monitors, run
the gcloud monitoring uptime list-configs
command:
gcloud monitoring uptime list-configs
The returned data includes the following:
- Name and display name.
- Check identifier.
- Monitored resource.
- Period between checks.
You can configure the Google Cloud CLI command to filter and sort the results.
API
To list your uptime checks and synthetic monitors, call the
projects.uptimeCheckConfigs.list
method. Specify the following parameters:
parent: The project whose uptime checks you want to list. The format is:
projects/PROJECT_ID
To get a specific uptime check, call the
projects.uptimeCheckConfigs.get
method. Specify the following parameter:
name: The full name of the uptime check configuration.
projects/PROJECT_ID/uptimeCheckConfigs/CHECK_ID
For more information about the uptime-check identifier, see Find the unique identifier of an uptime check.
C#
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
View details of an uptime check
Console
-
In the Google Cloud console, go to the Uptime checks page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
Locate the uptime check that you want to view, and then click its name.
The following screenshot shows the uptime details for an uptime check with the name "My Uptime Check":
The Uptime details page contains the following information:
- The selected time interval. By default, the interval is 1 hour.
- The name of the uptime check. In the sample, the name is My Uptime Check.
- The labels that you added to the uptime check.
The uptime percentage and the average latency. The Percent uptime value is a percentage calculated as
(S/T)*100
, whereS
is the number of successful check responses andT
is the total number of check responses, from all locations. For group checks, the values ofS
andT
are summed across all current group members.For example, over a 25-minute period, an uptime check with a one-minute period running from all regions would get 25 requests from each of 6 locations, for a total of 150 requests. If the dashboard reports an 83.3% uptime, then 125 of 150 requests succeeded.
The Passed checks and Uptime check latency panes graphically display the number of passed checks and latency of each check as a function of time.
The Current status pane displays the status of the most recent checks. A green circle with a check next to a region indicates the last run of the check in that region succeeded; a red circle with an x indicates failure.
The Configuration pane shows the configuration of the uptime check. This data is assigned when the uptime check is created. The Check Id value corresponds to the
CHECK_ID
value in API calls.The Alert Policies pane lists information about associated alerting policies. In the sample dashboard, one alerting policy is configured.
gcloud
To list the details of an uptime check or synthetic monitor,
run the gcloud monitoring uptime describe
command:
gcloud monitoring uptime describe CHECK_ID
Before you run the previous command, replace CHECK_ID with
the identifier of the uptime check or synthetic monitor. You can find the
identifier by running the gcloud monitoring uptime list-configs
command and
examining the name field. For more information, see
Find the unique identifier of an uptime check.
The data returned for the uptime check includes the following:
- Name and display name.
- Check identifier.
- Monitored resource.
- Period between checks.
API
To list the details of an uptime check or synthetic monitor, call the
projects.uptimeCheckConfigs.get
method. Specify the following parameter:
name: The full name of the uptime check configuration.
projects/PROJECT_ID/uptimeCheckConfigs/CHECK_ID
For more information about the uptime-check identifier, see Find the unique identifier of an uptime check.
C#
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Edit an uptime check
You can modify some fields of an uptime check. For example, you might want the check to occur more frequently, or you might want to increase the timeout associated with validation of the response. However, if your uptime check isn't configured with the correct protocol, resource type, or resource, then delete the current uptime check and create a new one.
For information about how to edit an alerting policy that monitors an uptime check, see the following documents:
To edit a public uptime check, you can use the process on any of the following tabs. To edit a private uptime check, use the Console or API tab:
Console
-
In the Google Cloud console, go to the Uptime checks page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
Locate the uptime check that you want to edit, then do one of the following:
- Click More more_vert and select Edit.
- View the uptime check details, and then click Edit.
Change the values of the fields as needed. You can't modify all fields. If the custom header values of a check are hidden, you cannot make them viewable.
To verify if the check works, click Test. If the test fails, see Failed checks for possible causes.
Click Save.
gcloud
To modify an uptime check or synthetic monitor,
run the gcloud monitoring uptime update
command:
gcloud monitoring uptime update CHECK_ID OPTIONAL_FLAGS
Before you run the previous command, do the following:
Replace CHECK_ID with the identifier of the uptime check or synthetic monitor. You can find the identifier by running the
gcloud monitoring uptime list-configs
command and examining the name field. For more information, see Find the unique identifier of an uptime check.Define which fields that you want to modify.
For example, to set the period of an uptime check to be 10 minutes, run the following command:
gcloud monitoring uptime update CHECK_ID --period=10
API
Call the projects.uptimeCheckConfigs.patch
method. Set the parameters to the method as follows:
uptimeCheckConfig.name: Required. This is part of the REST URL. It is the resource name of the uptime check to edit:
projects/PROJECT_ID/uptimeCheckConfigs/CHECK_ID
For more information about the uptime-check identifier, see Find the unique identifier of an uptime check.
updateMask: Optional. This is a query parameter:
?updateMask=[FIELD_LIST]
.[FIELD_LIST]
is a comma-separated list of fields in theUptimeCheckConfig
object that should be changed. For example:"resource.type,httpCheck.path"
The request body must contain an
UptimeCheckConfig
with the new field values.
If updateMask
is set, then only the fields listed in updateMask
replace
the corresponding fields in the existing configuration. If a field has
subfields, and the field is listed in the field mask but none of its subfields
are, then all subfields of that field replace the corresponding fields.
If updateMask
isn't set, then the configuration in the request body
replaces the entire existing configuration.
The patch
method returns the
UptimeCheckConfig
object for the altered configuration.
C#
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
There can be a delay of up to 5 minutes before you see the new uptime check results. During that time, the results of the former uptime check are displayed in the dashboards and used in alerting policies.
Delete an uptime check
We recommend that you delete an uptime check when you turn down the service or resource it monitors. Note: Before you delete an uptime check, ensure that there are no alerting policies that monitor the uptime check. When an alerting policy monitors an uptime check, the Google Cloud console prevents deletion of that uptime check. However, the Cloud Monitoring API doesn't generate an error or prevent deletion. No incident is created for the missing check.
To delete an uptime check, do the following:
Console
-
In the Google Cloud console, go to the Uptime checks page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
Locate the uptime check that you want to edit, then do one of the following:
- Click More more_vert and select Delete.
- View the uptime check details, and then click Delete
gcloud
To delete an uptime check or synthetic monitor,
run the gcloud monitoring uptime delete
command:
gcloud monitoring uptime delete CHECK_ID
Before you run the previous command, replace CHECK_ID with
the identifier of the uptime check or synthetic monitor. You can find the
identifier by running the gcloud monitoring uptime list-configs
command and
examining the name field. For more information, see
Find the unique identifier of an uptime check.
API
To delete an uptime check or a synthetic monitor, call the
projects.uptimeCheckConfigs.delete
method. Fill out the parameter as follows:
name: Required. This is the resource name of the uptime check configuration to delete:
projects/PROJECT_ID/uptimeCheckConfigs/CHECK_ID
For more information about the uptime-check identifier, see Find the unique identifier of an uptime check.
C#
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To authenticate to Monitoring, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Monitor an uptime check
We recommend that you create an alerting policy to notify you when your uptime check fails. For more information, see Create alerting policies for uptime checks.
Find the unique identifier of an uptime check
When your uptime check is created, Monitoring assigns it an identifier, referred to as the uptime-check ID. This identifier is embedded in the resource name for the uptime check:
projects/PROJECT_ID/uptimeCheckConfigs/CHECK_ID
The uptime-check ID is included in the response of Cloud Monitoring API methods that create or list uptime checks. You can also find the uptime-check ID in the Configuration pane of the Uptime details page in the Google Cloud console. For information about how to view the Uptime details page, see the View details of an uptime check section of this document.
What's next
- List uptime-check server IP addresses
- Create alerting policies for uptime checks
- Chart uptime-check metrics