skillfed

azure-monitor-querymetrics

Microsoft Corporation Azure Monitor Query Metrics Client Library for Python

azure-monitor-querymetrics v1.0.0 86.2K downloads/30d#13,877 on PyPI5,588
Permissive license MIT License Active released

What it is and what it does

This is the official Azure SDK client library for querying metrics from Azure Monitor's data platform. It provides both synchronous and asynchronous APIs to retrieve time-series numerical data from Azure resources. The library handles authentication via Azure credential objects and supports batch queries across multiple resources in a single request, making it efficient for monitoring and alerting workflows.

The package wraps the Azure Monitor Metrics Data Plane API and returns structured response objects containing metric values organized by resource, metric name, and time series. It requires Python 3.9 or later, appropriate Azure role-based access, and knowledge of Azure resource IDs and metric namespaces. Async usage requires an additional transport library.

Use it for:

  • Retrieve metrics from multiple Azure resources to build custom dashboards or reports
  • Programmatically fetch historical metric data for troubleshooting performance issues or capacity planning
  • Integrate Azure Monitor metrics into alerting systems that need to query multiple resources in batch
  • Build monitoring applications that aggregate metrics across resource groups
  • Export Azure resource metrics to external analytics or data warehousing systems

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Query and retrieve numerical metrics data from Azure Monitor for Azure resources, supporting batch queries across multiple resources with configurable aggregations and time ranges.

Yes. This is a production-stable (1.0.0), actively maintained official Azure SDK library with no known vulnerabilities, permissive licensing, and low install friction. Install it if you need to query Azure Monitor metrics programmatically from Python; it is the standard way to do so within the Azure SDK ecosystem.

Install

azure-monitor-querymetrics on PyPI

pip

pip install azure-monitor-querymetrics

uv

uv add azure-monitor-querymetrics

poetry

poetry add azure-monitor-querymetrics

Installing azure-monitor-querymetrics

Before you install

Low install friction with three lightweight runtime dependencies (isodate, azure-core, typing-extensions). Active maintenance status with recent release history and no known vulnerabilities.

License in practice

MIT License permits unrestricted use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

pip install azure-monitor-querymetrics

from azure.identity import DefaultAzureCredential
from azure.monitor.querymetrics import MetricsClient

credential = DefaultAzureCredential()
metrics_client = MetricsClient("https://westus3.metrics.monitor.azure.com", credential)

Requires Python 3.9 or later and Azure subscription with Monitoring Reader role authorization to read metrics data at the subscription level.

Verify before relying

  • Whether the package supports querying metrics across Azure subscriptions or only within a single subscription
  • Performance characteristics when querying large numbers of resources or long time spans
  • Whether retry logic and rate-limiting are built-in or require manual handling

Package facts

License MIT License (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — isodate, azure-core, typing-extensions
Maintenance actively maintained — 382 days since the last release
Last repo commit
First released
Downloads 86,250/month — #13,877 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: azure_monitor_querymetrics-1.0.0-py3-none-any.whl

Keywords: azure, azure sdk

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

azure monitor metrics queryazure metrics client libraryquery azure resource metricsazure monitoring data retrievalazure metrics batch queryazure monitor time series dataazure resource performance metrics
azure-sdkcloud-monitoringtime-series-data

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

azure-monitor-query

Executes read-only queries against Azure…

permissive · top 5,000 on PyPI

azure-mgmt-monitor

Provides programmatic access to Azure Monitor…

permissive · top 5,000 on PyPI

azure-monitor-ingestion

Sends custom logs and structured data to Azure…

permissive · top 5,000 on PyPI

nextcloudmonitor

Wraps the Nextcloud monitor API to retrieve…

permissive · top 15,000 on PyPI

applicationinsights

Sends telemetry events, metrics, and traces to…

permissive · top 5,000 on PyPI

netflix-spectator-py

A thin-client metrics library that sends…

permissive · top 5,000 on PyPI

awsme

Sends AWS CloudWatch metrics asynchronously and…

permissive · top 15,000 on PyPI

azure-mgmt-resource-subscriptions

Manages Azure subscriptions and related…

permissive · top 15,000 on PyPI

azure-monitor-opentelemetry-exporter

Exports OpenTelemetry traces, metrics, and logs…

permissive · top 1,000 on PyPI

metricflow

MetricFlow compiles metric definitions into…

permissive · top 5,000 on PyPI