Table: azure_compute_virtual_machine_metric_cpu_utilization - Query Azure Compute Virtual Machine Metrics using SQL
Azure Compute is a service within Microsoft Azure that allows you to deploy and manage virtual machines. These virtual machines can be used to run applications, host databases, and perform other computing tasks. The CPU utilization metric provides information on the percentage of total CPU resources that are being used by a virtual machine.
Table Usage Guide
The azure_compute_virtual_machine_metric_cpu_utilization
table provides insights into the CPU utilization of virtual machines within Azure Compute. As a system administrator or DevOps engineer, explore CPU-specific details through this table, including the percentage of total CPU resources that are being used. Utilize it to monitor the performance of your virtual machines, identify those that are under heavy load, and make informed decisions about resource allocation and scaling.
Examples
Basic info
Determine the areas in which your Azure virtual machines' CPU utilization varies over time. This query helps you analyze performance trends and optimize resource allocation for improved efficiency.
select name, timestamp, minimum, maximum, average, sample_countfrom azure_compute_virtual_machine_metric_cpu_utilizationorder by name, timestamp;
select name, timestamp, minimum, maximum, average, sample_countfrom azure_compute_virtual_machine_metric_cpu_utilizationorder by name, timestamp;
CPU Over 80% average
Determine the areas in which the average CPU usage of Azure virtual machines exceeds 80%. This can be useful to identify potential performance issues and optimize resource allocation.
select name, timestamp, round(minimum :: numeric, 2) as min_cpu, round(maximum :: numeric, 2) as max_cpu, round(average :: numeric, 2) as avg_cpu, sample_countfrom azure_compute_virtual_machine_metric_cpu_utilizationwhere average > 80order by name, timestamp;
select name, timestamp, round(minimum, 2) as min_cpu, round(maximum, 2) as max_cpu, round(average, 2) as avg_cpu, sample_countfrom azure_compute_virtual_machine_metric_cpu_utilizationwhere average > 80order by name, timestamp;
Schema for azure_compute_virtual_machine_metric_cpu_utilization
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
average | double precision | The average of the metric values that correspond to the data point. | |
cloud_environment | text | The Azure Cloud Environment. | |
maximum | double precision | The maximum metric value for the data point. | |
minimum | double precision | The minimum metric value for the data point. | |
name | text | The name of the virtual machine. | |
resource_group | text | The resource group which holds this resource. | |
sample_count | double precision | The number of metric values that contributed to the aggregate value of this data point. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
subscription_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Azure Subscription ID in which the resource is located. |
sum | double precision | The sum of the metric values for the data point. | |
timestamp | timestamp with time zone | The time stamp used for the data point. | |
unit | text | The units in which the metric value is reported. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- azure
You can pass the configuration to the command with the --config
argument:
steampipe_export_azure --config '<your_config>' azure_compute_virtual_machine_metric_cpu_utilization