Query metrics from Azure Monitor.

yaml
type: "io.kestra.plugin.azure.monitoring.Query"

Query CPU utilization from Azure Monitor for multiple VMs

yaml
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

Azure Monitor Metrics regional endpoint

Must be the regional endpoint (e.g. https://westeurope.metrics.monitor.azure.com)

SubType string

List of metric names to query

Metrics namespace

The namespace of the metrics, e.g., 'Microsoft.Compute/virtualMachines'

SubType string

List of Azure Resource IDs to query metrics from

Tenant ID

SubType string

Aggregation types

List of aggregation types: Average, Total, Maximum, Minimum, Count

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.

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 expression to apply to the query

Format duration

Time grain for data aggregation

ISO 8601 duration format, e.g., PT1M for 1 minute

Order by clause for sorting results

PEM Certificate

text
Your stored PEM certificate.
The tenantId, clientId and clientCertificate of the service principal are required for this credential to acquire an access token.

Dimension name(s) to rollup results by

For example, 'City' to combine multiple city dimension values into one timeseries

Top N time series to return

Default PT5M
Format duration

Time window for metrics

Duration looking back from now, e.g., PT5M for 5 minutes

Total number of datapoints fetched across all metrics and resources

Total number of unique metrics fetched across all resources

Total number of resources queried

SubType object

List of metrics results