Editing the MQL Expression for a Query

Directly edit the MQL expression used to query metric data in Monitoring.

For an example MQL expression, see Example Query and Metric Chart. For information about all query elements, including compartment and metric namespace, see Creating a Query. For troubleshooting, see Troubleshooting Monitoring or Troubleshooting Queries.

  • This section describes how to edit the MQL expression on the Metrics Explorer page. The MQL expression is available in Advanced mode only. For alarm query edits, see Creating a Basic Alarm.

    1. Create a basic query on the Metrics Explorer page.
    2. If the query isn't open, open it by clicking Edit queries.
    3. Click Advanced mode.
    4. Edit the text in the Query code editor box.
    5. Click Update Chart.
  • Use the oci monitoring metric-data summarize-metrics-data command and required parameters to query metric data. Use the --query-text parameter to specify the MQL expression.

    oci monitoring metric-data summarize-metrics-data [...] --query-text <mql_expression> [OPTIONS]

    For a complete list of flags and variable options for CLI commands, see the Command Line Reference for Monitoring.

  • Run the SummarizeMetricsData operation to query metric data. Use the query attribute to specify the MQL expression. For an example, see SummarizeMetricsDataDetails.