gcloud alpha monitoring policies conditions create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha monitoring policies conditions create - create a condition in an alerting policy
- SYNOPSIS
gcloud alpha monitoring policies conditions createALERT_POLICY[--aggregation=AGGREGATION--condition-display-name=CONDITION_DISPLAY_NAME--condition-filter=CONDITION_FILTER--duration=DURATION--if=IF_VALUE--trigger-count=TRIGGER_COUNT|--trigger-percent=TRIGGER_PERCENT][--condition=CONDITION|--condition-from-file=PATH_TO_FILE][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Create a condition in an alerting policy.- POSITIONAL ARGUMENTS
- Alert Policy resource - Name of the Alert Policy to add a condition to. Thisrepresents a Cloud resource. (NOTE) Some attributes are not given arguments inthis group but can be set in other ways.
To set the
projectattribute:- provide the argument
alert_policyon the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
ALERT_POLICY- ID of the Alert Policy or fully qualified identifier for the Alert Policy.
To set the
policyattribute:- provide the argument
alert_policyon the command line.
- provide the argument
- provide the argument
- Alert Policy resource - Name of the Alert Policy to add a condition to. Thisrepresents a Cloud resource. (NOTE) Some attributes are not given arguments inthis group but can be set in other ways.
- FLAGS
- Condition Settings. This will add a condition to the created policy. If anyconditions are already specified, this condition will be appended.
--aggregation=AGGREGATION- Specifies an Aggregation message as a JSON/YAML value to be applied to thecondition. For more information about the format:https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies
--condition-display-name=CONDITION_DISPLAY_NAME- The display name for the condition.
--condition-filter=CONDITION_FILTER- Specifies the "filter" in a metric absence or metric threshold condition.
--duration=DURATION- The duration (e.g. "60s", "2min", etc.) that the condition must hold in order totrigger as true.
--if=IF_VALUE- One of "absent", "< THRESHOLD", "> THRESHOLD" where "THRESHOLD" is aninteger or float.
- At most one of these can be specified:
--trigger-count=TRIGGER_COUNT- The absolute number of time series that must fail the predicate for thecondition to be triggered.
--trigger-percent=TRIGGER_PERCENT- The percentage of time series that must fail the predicate for the condition tobe triggered.
- At most one of these can be specified:
--condition=CONDITION- The condition as a string. In either JSON or YAML format.
--condition-from-file=PATH_TO_FILE- The path to a JSON or YAML file containing the condition. Use a full or relativepath to a local file containing the value of condition.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - NOTES
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudmonitoringpoliciesconditionscreategcloudbetamonitoringpoliciesconditionscreate
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-21 UTC.