Reference documentation and code samples for the Stackdriver Monitoring V3 Client class MetricAbsence.
A condition type that checks that monitored resources
are reporting data. The configuration defines a metric and
a set of monitored resources. The predicate is considered in violation
when a time series for the specified metric of a monitored
resource does not include any data in the specified duration.
Generated from protobuf message google.monitoring.v3.AlertPolicy.Condition.MetricAbsence
Required. A filter that identifies which time series should be compared with the threshold. The filter is similar to the one that is specified in the ListTimeSeries request (that call is useful to verify the time series that will be retrieved / processed). The filter must specify the metric type and the resource type. Optionally, it can specify resource labels and metric labels. This field must not exceed 2048 Unicode characters in length.
Specifies the alignment of data points in individual time series as well as how to combine the retrieved time series together (such as when aggregating multiple streams on each resource to a single stream for each resource or when aggregating streams across all members of a group of resources). Multiple aggregations are applied in the order specified. This field is similar to the one in the ListTimeSeries request. It is advisable to use the ListTimeSeries method when debugging this field.
The amount of time that a time series must fail to report new data to be considered failing. The minimum value of this field is 120 seconds. Larger values that are a multiple of a minute--for example, 240 or 300 seconds--are supported. If an invalid value is given, an error will be returned. The Duration.nanos field is ignored.
The number/percent of time series for which the comparison must hold in order for the condition to trigger. If unspecified, then the condition will trigger if the comparison is true for any of the time series that have been identified by filter and aggregations.
getFilter
Required. A
filter that
identifies which time series should be compared with the threshold.
The filter is similar to the one that is specified in the
ListTimeSeries
request
(that call is useful to verify the time series that will be retrieved /
processed). The filter must specify the metric type and the resource
type. Optionally, it can specify resource labels and metric labels.
This field must not exceed 2048 Unicode characters in length.
Returns
Type
Description
string
setFilter
Required. A
filter that
identifies which time series should be compared with the threshold.
The filter is similar to the one that is specified in the
ListTimeSeries
request
(that call is useful to verify the time series that will be retrieved /
processed). The filter must specify the metric type and the resource
type. Optionally, it can specify resource labels and metric labels.
This field must not exceed 2048 Unicode characters in length.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getAggregations
Specifies the alignment of data points in individual time series as
well as how to combine the retrieved time series together (such as
when aggregating multiple streams on each resource to a single
stream for each resource or when aggregating streams across all
members of a group of resources). Multiple aggregations
are applied in the order specified.
This field is similar to the one in the ListTimeSeries
request.
It is advisable to use the ListTimeSeries method when debugging this
field.
Specifies the alignment of data points in individual time series as
well as how to combine the retrieved time series together (such as
when aggregating multiple streams on each resource to a single
stream for each resource or when aggregating streams across all
members of a group of resources). Multiple aggregations
are applied in the order specified.
This field is similar to the one in the ListTimeSeries
request.
It is advisable to use the ListTimeSeries method when debugging this
field.
The amount of time that a time series must fail to report new
data to be considered failing. The minimum value of this field
is 120 seconds. Larger values that are a multiple of a
minute--for example, 240 or 300 seconds--are supported.
If an invalid value is given, an
error will be returned. The Duration.nanos field is
ignored.
The amount of time that a time series must fail to report new
data to be considered failing. The minimum value of this field
is 120 seconds. Larger values that are a multiple of a
minute--for example, 240 or 300 seconds--are supported.
If an invalid value is given, an
error will be returned. The Duration.nanos field is
ignored.
The number/percent of time series for which the comparison must hold
in order for the condition to trigger. If unspecified, then the
condition will trigger if the comparison is true for any of the
time series that have been identified by filter and aggregations.
The number/percent of time series for which the comparison must hold
in order for the condition to trigger. If unspecified, then the
condition will trigger if the comparison is true for any of the
time series that have been identified by filter and aggregations.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Stackdriver Monitoring V3 Client - Class MetricAbsence (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-monitoring/latest/V3.AlertPolicy.Condition.MetricAbsence)\n- [2.1.1](/php/docs/reference/cloud-monitoring/2.1.1/V3.AlertPolicy.Condition.MetricAbsence)\n- [2.0.1](/php/docs/reference/cloud-monitoring/2.0.1/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.12.1](/php/docs/reference/cloud-monitoring/1.12.1/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.11.1](/php/docs/reference/cloud-monitoring/1.11.1/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.10.3](/php/docs/reference/cloud-monitoring/1.10.3/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.9.0](/php/docs/reference/cloud-monitoring/1.9.0/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.8.0](/php/docs/reference/cloud-monitoring/1.8.0/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.7.1](/php/docs/reference/cloud-monitoring/1.7.1/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.6.0](/php/docs/reference/cloud-monitoring/1.6.0/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.5.1](/php/docs/reference/cloud-monitoring/1.5.1/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.4.0](/php/docs/reference/cloud-monitoring/1.4.0/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.3.2](/php/docs/reference/cloud-monitoring/1.3.2/V3.AlertPolicy.Condition.MetricAbsence)\n- [1.2.2](/php/docs/reference/cloud-monitoring/1.2.2/V3.AlertPolicy.Condition.MetricAbsence) \nReference documentation and code samples for the Stackdriver Monitoring V3 Client class MetricAbsence.\n\nA condition type that checks that monitored resources\nare reporting data. The configuration defines a metric and\na set of monitored resources. The predicate is considered in violation\nwhen a time series for the specified metric of a monitored\nresource does not include any data in the specified `duration`.\n\nGenerated from protobuf message `google.monitoring.v3.AlertPolicy.Condition.MetricAbsence`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Monitoring \\\\ V3 \\\\ AlertPolicy \\\\ Condition\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getFilter\n\nRequired. A\n[filter](https://cloud.google.com/monitoring/api/v3/filters) that\nidentifies which time series should be compared with the threshold.\n\nThe filter is similar to the one that is specified in the\n[`ListTimeSeries`\nrequest](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)\n(that call is useful to verify the time series that will be retrieved /\nprocessed). The filter must specify the metric type and the resource\ntype. Optionally, it can specify resource labels and metric labels.\nThis field must not exceed 2048 Unicode characters in length.\n\n### setFilter\n\nRequired. A\n[filter](https://cloud.google.com/monitoring/api/v3/filters) that\nidentifies which time series should be compared with the threshold.\n\nThe filter is similar to the one that is specified in the\n[`ListTimeSeries`\nrequest](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)\n(that call is useful to verify the time series that will be retrieved /\nprocessed). The filter must specify the metric type and the resource\ntype. Optionally, it can specify resource labels and metric labels.\nThis field must not exceed 2048 Unicode characters in length.\n\n### getAggregations\n\nSpecifies the alignment of data points in individual time series as\nwell as how to combine the retrieved time series together (such as\nwhen aggregating multiple streams on each resource to a single\nstream for each resource or when aggregating streams across all\nmembers of a group of resources). Multiple aggregations\nare applied in the order specified.\n\nThis field is similar to the one in the [`ListTimeSeries`\nrequest](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).\nIt is advisable to use the `ListTimeSeries` method when debugging this\nfield.\n\n### setAggregations\n\nSpecifies the alignment of data points in individual time series as\nwell as how to combine the retrieved time series together (such as\nwhen aggregating multiple streams on each resource to a single\nstream for each resource or when aggregating streams across all\nmembers of a group of resources). Multiple aggregations\nare applied in the order specified.\n\nThis field is similar to the one in the [`ListTimeSeries`\nrequest](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).\nIt is advisable to use the `ListTimeSeries` method when debugging this\nfield.\n\n### getDuration\n\nThe amount of time that a time series must fail to report new\ndata to be considered failing. The minimum value of this field\nis 120 seconds. Larger values that are a multiple of a\nminute--for example, 240 or 300 seconds--are supported.\n\nIf an invalid value is given, an\nerror will be returned. The `Duration.nanos` field is\nignored.\n\n### hasDuration\n\n### clearDuration\n\n### setDuration\n\nThe amount of time that a time series must fail to report new\ndata to be considered failing. The minimum value of this field\nis 120 seconds. Larger values that are a multiple of a\nminute--for example, 240 or 300 seconds--are supported.\n\nIf an invalid value is given, an\nerror will be returned. The `Duration.nanos` field is\nignored.\n\n### getTrigger\n\nThe number/percent of time series for which the comparison must hold\nin order for the condition to trigger. If unspecified, then the\ncondition will trigger if the comparison is true for any of the\ntime series that have been identified by `filter` and `aggregations`.\n\n### hasTrigger\n\n### clearTrigger\n\n### setTrigger\n\nThe number/percent of time series for which the comparison must hold\nin order for the condition to trigger. If unspecified, then the\ncondition will trigger if the comparison is true for any of the\ntime series that have been identified by `filter` and `aggregations`."]]