I have used MQL to create charts in Google Cloud Monitoring that are a ratio of two metrics.
I would like to create an alerting policy based on the MQL, but the UI in Cloud Console does not have a query editor, like it does in Metrics Explorer.
Is there a way to use MQL when defining conditions for alerting policies using Google Cloud Monitoring (Stackdriver)?
Creating alerts with MQL is now supported :) Both in UI and API.
To create a valid alert - pipe either condition
or absent_for
keyword* at the end of your query. See https://cloud.google.com/monitoring/mql/alerts for documentation.
For ratio alerts, follow the tips from regular ratio queries https://cloud.google.com/monitoring/mql/examples#qlx-ratio-ratio
There are two major difference compared to dashboards - all MQL alerts must be saved in strict-form, and most of the conditions will need to have units-of-measure specified. See https://cloud.google.com/monitoring/mql/qn-from-api#ql-alert-condition
) * - they are technically "table operators", not "keywords".