Building Metric Queries
View custom metric charts, list metric definitions, and query metric data for resources of interest.
The following pages describe tasks you can perform with metric charts, metric definitions, and queries of metric data.
- IAM policies: Querying metrics is part of monitoring. To monitor resources, you must be given the required type of access in a policy written by an administrator, whether you're using the Console or the REST API with an SDK, CLI, or other tool. The policy must give you access to the monitoring services as well as the resources being monitored. If you try to perform an action and get a message that you don't have permission or are unauthorized, confirm with your administrator the type of access you've been granted and which compartment you should work in. For more information about user authorizations for monitoring, see IAM Policies (Monitoring). Administrators: For common policies that give groups access to metrics, see Metric Access for Groups.
- Metrics exist in Monitoring: The resources that you want to monitor must emit metrics to the Monitoring service.
- Compute instances: To emit metrics, the Compute Instance Monitoring plugin must be enabled on the instance, and plugins must be running. The instance must also have either a service gateway or a public IP address to send metrics to the Monitoring service. For more information, see Enabling Monitoring for Compute Instances.