Professional Cloud Security EngineerManaging operationsMedium

A security analyst needs to create a custom dashboard in Cloud Monitoring to visualize specific security-related metrics, such as the number of `IAM policy changes` over time, `failed login attempts` from specific IP ranges, and `storage bucket permission changes`. They want to use a query language that allows for complex aggregations and transformations of log data for these visualizations. Which query language should the analyst use in Cloud Monitoring?

  1. ACloud Logging query language
  2. BSQL for BigQuery
  3. CPrometheus Query Language (PromQL)
  4. DMonitoring Query Language (MQL)
Show answer & explanation

Correct answer: D. Monitoring Query Language (MQL)

Monitoring Query Language (MQL) is a powerful, expressive, and declarative language used for querying, aggregating, and transforming metric and log data in Cloud Monitoring. It is specifically designed for creating custom dashboards and alerting policies based on complex conditions, including those derived from log entries.

Why the other options are wrong

  • A. The Cloud Logging query language is for filtering and viewing logs, but MQL provides more advanced aggregation and transformation capabilities for metrics derived from logs in Cloud Monitoring.
  • B. SQL for BigQuery is for querying data stored in BigQuery, not for directly creating custom dashboards and alerts within Cloud Monitoring based on live log streams.
  • C. PromQL is for Prometheus metrics, not native Cloud Logging or custom Cloud Monitoring aggregations of log data.

Monitoring Query Language (MQL)

A powerful, declarative query language used in Google Cloud Monitoring for defining, aggregating, and transforming metrics and log data to create custom dashboards, alerting policies, and troubleshoot issues.

  • Used for both metrics and log-based metrics.
  • Supports complex aggregations, transformations, and filtering.
  • Enables creation of advanced alerting policies and dashboards.
  • Offers flexible control over data visualization.

Memory trick: MQL is the 'Master Query Language' for your Monitoring 'metrics' and 'logs'.

More Managing operations questions