Skip to main content

alerts

Creates, updates, deletes, gets or lists an alerts resource.

Overview

Namealerts
TypeResource
Idgoogle.monitoring.alerts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The name of the alert.The format is: projects/[PROJECT_ID_OR_NUMBER]/alerts/[ALERT_ID] The [ALERT_ID] is a system-assigned unique identifier for the alert.
closeTimestring (google-datetime)The time when the alert was closed.
logobjectThe log information associated with the alert. This field is only populated for log-based alerts. (id: LogMetadata)
metadataobjectThe metadata of the monitored resource. (id: MonitoredResourceMetadata)
metricobjectThe metric type and any metric labels preserved from the incident's generating condition. (id: Metric)
openTimestring (google-datetime)The time when the alert was opened.
policyobjectThe snapshot of the alert policy that generated this alert. (id: PolicySnapshot)
resourceobjectAn object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for "gce_instance" has labels "project_id", "instance_id" and "zone": { "type": "gce_instance", "labels": { "project_id": "my-project", "instance_id": "12345678901234", "zone": "us-central1-a" }} (id: MonitoredResource)
statestringOutput only. The current state of the alert.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_alerts_getselectprojectsId, alertsIdGets a single alert.
projects_alerts_listselectprojectsIdfilter, orderBy, pageSize, pageTokenLists the existing alerts for the metrics scope of the project.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
alertsIdstring
projectsIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets a single alert.

SELECT
name,
closeTime,
log,
metadata,
metric,
openTime,
policy,
resource,
state
FROM google.monitoring.alerts
WHERE projectsId = '{{ projectsId }}' -- required
AND alertsId = '{{ alertsId }}' -- required
;