How to trigger an alert when a message in a topic moved to DeadLetterQueue in ServiceBus

Arun Kumar KS 36 Reputation points
2022-06-15T13:00:02.017+00:00

How to trigger an alert when a message in a topic moved to DeadLetterQueue in ServiceBus

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

3 answers

Sort by: Most helpful
  1. MayankBargali-MSFT 70,556 Reputation points
    2022-06-15T13:59:19.47+00:00

    @Arun Kumar KS Thanks for reaching out. You can refer to this document to get started on how to analyze service bus metrics. The available message metrics are listed here.
    As per your requirement you need to create the alert on Count of dead-lettered messages in a Queue/Topic metric and as per your requirement you can set the condition and evaluation.
    Now you can perform what Actions you want to perform on this alert.

    For more details on monitoring alerts, you can refer to this document. For creating alert, please refer to this document.

    In case if you are looking to process the message when the message is received in dead letter queue then you can leverage the azure function service bus trigger or logic app workflows with service bus trigger.

    Feel free to get back to me if you need any assistance.

    1 person found this answer helpful.

  2. Rajesh Kadam 0 Reputation points
    2023-02-22T05:48:36.6733333+00:00

    Enable diagnostic logs for your Service Bus namespace

    Log Analytics query that retrieves events related to messages being moved to the DLQ. A sample query might look like this:

    AzureDiagnostics | where ResourceType == "SERVICEBUS" | where Category == "Deadletter" | where Message contains "moved to DeadLetter"

    Create an Azure Monitor alert based on the Log Analytics query. You can do this by going to the Log Analytics workspace in the Azure portal, selecting "Alerts" in the left-hand menu, and creating a new alert based on the query you created in step 2. Configure the alert to send an email or other notification when triggered.

    HOPE THIS HELP


  3. Čestmír Peltan 5 Reputation points
    2023-04-20T11:06:11.9366667+00:00

    I solved the alerting by creating Alert rule under the service bus namespace. You can filter the alert by specific topic. The filter by topic was what I was missing in the Alert originally. Now I create alert rule for each topic I want to monitor and set the alert to trigger anytime theres more that 1 message in Dead-Letter queue. I have deleted all the old Dead-Letter message to start from 0 count.
    User's image

    User's image


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.