How to access service bus queues metrics in Azure Metrics Exporter

Byna, Gayathri 0 Reputation points
2025-01-07T15:43:44.7233333+00:00

I'm sending Azure metrics to Prometheus and setting up prometheus alerts. I'm able to send Azure Metrics for all Azure resources through resource id, but when trying to access Azure metrics for Service bus queues, i'm getting 400 error.

I'm using Robust Perception for Azure Metrics exporter.

https://github.com/RobustPerception/azure_metrics_exporter

Any suggestions on this topic will be really helpful.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,408 questions
Azure AI Metrics Advisor
Azure AI Metrics Advisor
An Azure artificial intelligence analytics service that proactively monitors metrics and diagnoses issues.
83 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Zafer KAYA 20 Reputation points MVP
    2025-01-08T12:12:09.75+00:00

    Ensure that the resource_id for the Service Bus queue is correctly specified.

    • The resource_id format for Service Bus queues is:
    • /subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.ServiceBus/namespaces/{namespace-name}/queues/{queue-name}

    Check your configuration in azure.yml. You should have something like:

    resource_groups:

    • resource_group: "your-resource-group" resource_types:
      • "Microsoft.ServiceBus/namespaces"
      metrics:
      • name: "Messages"
      • name: "ActiveMessages"
      • name: "DeadletteredMessages"
    1. Make sure you have the correct permissions set up:
    • The service principal needs "Monitoring Reader" role
    • For Service Bus specifically, you might also need "Azure Service Bus Data Owner" or "Azure Service Bus Data Reader"
    1. Verify the metrics you're trying to collect are available through the Azure Monitor API. Common Service Bus metrics include:
    • ActiveMessages
    • DeadletteredMessages
    • IncomingMessages
    • OutgoingMessages
    • ScheduledMessages
    • Make sure you have the correct permissions set up:
    • The service principal needs "Monitoring Reader" role
    • For Service Bus specifically, you might also need "Azure Service Bus Data Owner" or "Azure Service Bus Data Reader"
    • Verify the metrics you're trying to collect are available through the Azure Monitor API. Common Service Bus metrics include:
    • ActiveMessages
    • DeadletteredMessages
    • IncomingMessages
    • OutgoingMessages
    • ScheduledMessages

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.