@Catherine Du Thanks for reaching out. To monitor and view Azure Service Bus metrics such as queue size without needing an elevation request every time, you can use the Azure Monitor REST API. This API allows you to programmatically access metrics and logs for your Azure resources, including Azure Service Bus. You can then integrate these metrics with Kusto or Geneva for further analysis and visualization.
The API provides various endpoints to query metrics, logs, and alerts. You can use the metrics
endpoint to retrieve metrics such as queue size.
Example API request to fetch Service Bus queue size metrics:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/providers/microsoft.insights/metrics?api-version=2018-01-01&metricnames=Size
Once you have the metrics, you can use Kusto to store and analyze the data. You can create a scheduled task to periodically fetch metrics using the Azure Monitor REST API and ingest them into Kusto.
please try and let me know incase of further queries, I would be happy to assist you.