azure-monitor-querymetrics
Microsoft Corporation Azure Monitor Query Metrics Client Library for Python
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-querymetricsuv
uv add azure-monitor-querymetricspoetry
poetry add azure-monitor-querymetricsInstalling 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
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
azure-monitor-queryExecutes read-only queries against Azure…
permissive · top 5,000 on PyPI
azure-mgmt-monitorProvides programmatic access to Azure Monitor…
permissive · top 5,000 on PyPI
azure-monitor-ingestionSends custom logs and structured data to Azure…
permissive · top 5,000 on PyPI
nextcloudmonitorWraps the Nextcloud monitor API to retrieve…
permissive · top 15,000 on PyPI
applicationinsightsSends telemetry events, metrics, and traces to…
permissive · top 5,000 on PyPI
netflix-spectator-pyA thin-client metrics library that sends…
permissive · top 5,000 on PyPI
awsmeSends AWS CloudWatch metrics asynchronously and…
permissive · top 15,000 on PyPI
azure-mgmt-resource-subscriptionsManages Azure subscriptions and related…
permissive · top 15,000 on PyPI
azure-monitor-opentelemetry-exporterExports OpenTelemetry traces, metrics, and logs…
permissive · top 1,000 on PyPI
metricflowMetricFlow compiles metric definitions into…
permissive · top 5,000 on PyPI