Azure Monitor Metrics Batch API – top Parameter Behavior and Complete Time Series Retrieval

Ninave, Durgesh (Contractor) 40 Reputation points
2026-09-16T10:50:07.8666667+00:00

We are using the Azure Monitor Metrics Batch API (metrics:getBatch, API version 2023-10-01) to retrieve metric time-series data across multiple resource IDs and dimensions.

According to the API documentation, the top parameter specifies the maximum number of records to retrieve per resource ID when a filter is specified, and its default value is 10. The documentation also mentions that paging is not supported and recommends splitting queries into multiple parallel requests when the response contains a large volume of metric data.

We would like to clarify the following points for production usage:

  1. Behavior when top is reached If the number of matching time series is greater than the configured top value, does the API silently return only the top N time series, or does the response provide any indication that additional time series were omitted?
  2. Maximum supported value of top What is the maximum supported value for the top parameter?
  3. Observed maximum value During testing, we observed that 2,147,483,647 is accepted, while 2,147,483,648 returns a BadRequest with the error: Detected invalid TopN value ... should be Int value. Could you confirm whether 2,147,483,647 is the officially supported maximum value for top?
  4. Retrieving all matching time series If a production workload requires retrieving all matching time series across all dimensions, what approach does Microsoft recommend to ensure that no time series are missed?
  5. Recommended request-splitting strategy Since the Batch API does not support paging, should requests be split by:
    1. Resource ID
    2. Metric
    3. Dimension/filter
    4. A combination of these
    5. Or another recommended criteria?
  6. Detecting truncation Is there any response metadata, HTTP header, or other mechanism that can be used to determine whether the returned results were limited by the top parameter?

References

Any clarification on the expected behavior and Microsoft's recommended approach for guaranteeing complete time-series retrieval would be greatly appreciated.

Azure Monitor
Azure Monitor

An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.