Selecting a Resource Group in a Query

Limit returned metric data by matching a resource group when querying custom metric data in Monitoring.

Resource groups are available with custom metrics. Blank (null) for resource group returns metric data that doesn't have a resource group.

For troubleshooting, see Troubleshooting Queries.

  • This section describes how to select the resource group for a new query 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. Select the Compartment that contains the custom metric that you want.
    3. Select the Metric namespace that contains the custom metric that you want.
    4. Select the Resource group that you want.
    5. Provide minimum required fields: Select a Metric name.
    6. Click Update Chart.
  • Use the oci monitoring metric-data summarize-metrics-data command and required parameters to query metric data. Use the --resource-group parameter to select a resource group for the query.

    oci monitoring metric-data summarize-metrics-data --resource-group <resource_group_name> [...]

    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 resourceGroup attribute to select a resource group for the query.