Selecting the Metric Namespace for a Query

Select the metric namespace for querying metric data in Monitoring.

Before You Begin

IAM policies: To query metrics, you must be given the required type of access in a policy  written by an administrator. This requirement applies whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don't have permission or are unauthorized, check with the administrator. You might not have the required type of access in the current compartment .

Administrators: For example policies, see Query Metrics for a Metric Namespace (restricted to a metric namespace) and Query Metrics (unrestricted).

  • This section describes how to select the metric namespace on the Metrics Explorer page. 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. Select the Compartment that contains the metric namespace that you want.
      The page lists metric namespaces for the selected compartment. For example, if the current compartment contains load balancers, then the page includes oci_lbaas in its list of metric namespaces.
    4. Select the Metric namespace that you want.
    5. Click Update Chart.
  • Use the oci monitoring metric-data summarize-metrics-data command and required parameters to query metric data. Use the --namespace parameter to select the metric namespace for the query.

    oci monitoring metric-data summarize-metrics-data --namespace <metric_namespace> [...]

    For a complete list of parameters and values for CLI commands, see the Command Line Reference for Monitoring.

  • Run the SummarizeMetricsData operation to query metric data. Use the namespace attribute to select the metric namespace for the query. For an example, see SummarizeMetricsDataDetails.