Python 3.x Azure服务总线-获取挂起和正在处理的消息的计数

Python 3.x Azure服务总线-获取挂起和正在处理的消息的计数,python-3.x,azureservicebus,Python 3.x,Azureservicebus,我使用peek方法查看队列中的消息;返回的消息包含队列中的消息和正在处理的消息 我还研究了管理api,该api再次提供了活动消息计数,它包括正在处理的消息和正在处理的消息 是否有办法分别获取这两个计数?您可以使用Azure Monitor API: 管理API: 例如: /订阅/{subscriptionID}/resourceGroups/{resourcegroup}/providers/Microsoft.ServiceBus/namespaces/{namespacename}/prov

我使用peek方法查看队列中的消息;返回的消息包含队列中的消息和正在处理的消息

我还研究了管理api,该api再次提供了活动消息计数,它包括正在处理的消息和正在处理的消息


是否有办法分别获取这两个计数?

您可以使用Azure Monitor API:

管理API:

例如: /订阅/{subscriptionID}/resourceGroups/{resourcegroup}/providers/Microsoft.ServiceBus/namespaces/{namespacename}/providers/microsoft.Insights/metrics?timespan=2020-08-06T05:18:00.000Z/2020-08-06T06:18:00.000Z&interval=FULL&metricnames=ActiveMessages&aggregation=average&MetricNamespaces=microsoft.servicebus%2Namespaces&top=10&$filter=EntityName eq'{your EntityName}',rollupby=EntityName&validatedimensions=false&api version=2019-07-01