
Query
Query metrics from Azure Monitor.
Query metrics from Azure Monitor.
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
aggregationsarray
Aggregation types
List of aggregation types: Average, Total, Maximum, Minimum, Count
clientIdstring
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.
clientSecretstring
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.
filterstring
Filter expression to apply to the query
intervalstring
durationTime grain for data aggregation
ISO 8601 duration format, e.g., PT1M for 1 minute
orderBystring
Order by clause for sorting results
pemCertificatestring
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.
rollupBystring
Dimension name(s) to roll up results by
For example, 'City' to combine multiple city dimension values into one time series
topintegerstring
Top N time series to return
windowstring
PT5MdurationTime window for metrics
Duration looking back from now, e.g., PT5M for 5 minutes
Outputs
datapointsinteger
Total number of datapoints fetched across all metrics and resources
metricsinteger
Total number of unique metrics fetched across all resources
resourcesinteger
Total number of resources queried
resultsarray
List of metrics results