Query metrics from Azure Monitor.
type: "io.kestra.plugin.azure.monitoring.Query"Examples
Query CPU utilization from Azure Monitor for multiple VMs
id: "query"
type: "io.kestra.plugin.azure.monitoring.Query"
id: azure_monitor_query
namespace: company.team
tasks:
- id: query
type: io.kestra.plugin.azure.monitoring.Query
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
resourceIds:
- "/subscriptions/xxx/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm1"
- "/subscriptions/xxx/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm2"
metricNames:
- "Percentage CPU"
metricsNamespace: "Microsoft.Compute/virtualMachines"
window: PT5M
aggregations:
- "Average"
- "Maximum"
Properties
endpoint *Requiredstring
Azure Monitor Metrics regional endpoint
Must be the regional endpoint (e.g. https://westeurope.metrics.monitor.azure.com)
metricNames *Requiredarray
List of metric names to query
metricsNamespace *Requiredstring
Metrics namespace
The namespace of the metrics, e.g., 'Microsoft.Compute/virtualMachines'
resourceIds *Requiredarray
List of Azure Resource IDs to query metrics from
tenantId *Requiredstring
Tenant ID
aggregations array
Aggregation types
List of aggregation types: Average, Total, Maximum, Minimum, Count
clientId string
Client ID
Client ID of the Azure service principal. If you don't have a service principal, refer to create a service principal with Azure CLI.
clientSecret string
Client Secret
Service principal client secret. The tenantId, clientId and clientSecret of the service principal are required for this credential to acquire an access token.
filter string
Filter expression to apply to the query
interval string
durationTime grain for data aggregation
ISO 8601 duration format, e.g., PT1M for 1 minute
orderBy string
Order by clause for sorting results
pemCertificate string
PEM Certificate
Your stored PEM certificate.
The tenantId, clientId and clientCertificate of the service principal are required for this credential to acquire an access token.
rollupBy string
Dimension name(s) to rollup results by
For example, 'City' to combine multiple city dimension values into one timeseries
top integerstring
Top N time series to return
window string
PT5MdurationTime window for metrics
Duration looking back from now, e.g., PT5M for 5 minutes
Outputs
datapoints integer
Total number of datapoints fetched across all metrics and resources
metrics integer
Total number of unique metrics fetched across all resources
resources integer
Total number of resources queried
results array
List of metrics results