How to view Service Bus metrics/dashboard without elevation request?

Catherine Du 25 Reputation points Microsoft Employee
2024-10-21T20:26:17.2966667+00:00

Hello!

We are looking for ways to monitor and view Azure Service Bus metrics such as queue size without having to get an elevation request every time. Is there an API that we can call to fetch such metrics to directly view it in Kusto or Geneva?

If not, what is the most recommended way to Service Bus customers to conveniently and effectively access the metrics and dashboards that come with the Service Bus feature?

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
641 questions
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 28,086 Reputation points
    2024-10-23T17:26:29.1166667+00:00

    @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.

    reference: https://zcusa.951200.xyz/en-us/azure/azure-monitor/essentials/rest-api-walkthrough?tabs=rest%2Cportal#api-endpoints

    https://zcusa.951200.xyz/en-us/azure/service-bus-messaging/monitor-service-bus-reference#message-metrics

    please try and let me know incase of further queries, I would be happy to assist you.


0 additional answers

Sort by: Most helpful

Your answer

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