Event Grid Monitoring and Diagnostics

Azure Event Grid runs silently in the background, routing events from sources to handlers. But when something goes wrong — a handler stops responding, events pile up, or deliveries fail — you need visibility into what is happening. Azure provides built-in monitoring tools that track every aspect of Event Grid behavior.

Why Monitoring Matters for Event Grid

Event Grid operates asynchronously. Unlike a direct API call where you immediately know if something failed, event delivery happens in the background. Without monitoring, a broken subscription could silently drop thousands of events before anyone notices.

Think of it like a courier company. You hand packages (events) to the courier (Event Grid) and trust them to deliver. Monitoring is the tracking system that tells you: package received, delivery attempted, delivery failed, or package returned to sender.

Key Metrics Available in Azure Monitor

Azure Monitor collects Event Grid metrics automatically. No configuration is needed to start collecting them.
+------------------------------------------+
|          Azure Monitor Metrics           |
+------------------------------------------+
|  Published Events    --> Events sent to  |
|                          the topic       |
|                                          |
|  Matched Events      --> Events that     |
|                          match a filter  |
|                                          |
|  Delivered Events    --> Events sent to  |
|                          a handler       |
|                                          |
|  Failed Deliveries   --> Handler rejected|
|                          or unreachable  |
|                                          |
|  Dead Lettered       --> Moved to dead   |
|                          letter storage  |
+------------------------------------------+

Metric Descriptions

Metric NameWhat It MeasuresWhy It Matters
Published EventsTotal events sent to a topicConfirms sources are producing events
Matched EventsEvents matching at least one subscription filterShows how many events reach the routing layer
Delivered EventsEvents successfully sent to a handlerConfirms end-to-end delivery is working
Delivery Failed EventsEvents that could not reach a handlerIdentifies broken or misconfigured handlers
Dead Lettered EventsEvents moved to dead letter storageShows events that exceeded all retry attempts
Dropped EventsEvents with no matching subscriptionCatches misconfigured filters or missing subscriptions
Destination Processing DurationTime for handler to process an eventIdentifies slow handlers causing timeouts

Enabling Diagnostic Logs

Metrics give you numbers. Diagnostic logs give you details. Logs record every publish attempt, delivery attempt, and failure with timestamps and error codes.

Steps to Enable Diagnostic Logs

Azure Portal
    |
    +--> Event Grid Topic or Domain
         |
         +--> Diagnostic Settings
              |
              +--> Add Diagnostic Setting
                   |
                   +--> Select Log Categories:
                   |       - DeliveryFailures
                   |       - PublishFailures
                   |
                   +--> Choose Destination:
                           - Log Analytics Workspace (recommended)
                           - Storage Account
                           - Event Hub

Log Analytics Workspace is the best destination because it supports querying with Kusto Query Language (KQL).

Reading Delivery Failure Logs with KQL

Once logs flow into Log Analytics, you query them directly. The table name for Event Grid logs is AzureDiagnostics.
// Find all delivery failures in the last 24 hours
AzureDiagnostics
| where TimeGenerated > ago(24h)
| where ResourceType == "EVENTGRID/TOPICS"
| where OperationName == "DeliveryFailures"
| project TimeGenerated, subject_s, errorCode_s, errorMessage_s
| order by TimeGenerated desc
// Count failures by error code
AzureDiagnostics
| where OperationName == "DeliveryFailures"
| summarize FailureCount = count() by errorCode_s
| order by FailureCount desc

Common Error Codes in Delivery Failures

Error CodeMeaningFix
400Handler rejected the event (bad request)Check handler code for validation errors
401Handler authentication failedCheck webhook secret or managed identity permissions
404Handler endpoint not foundVerify the subscription endpoint URL is correct
408Handler timed outOptimize handler code or increase timeout limit
500Handler threw an internal errorCheck handler logs for exceptions
503Handler service unavailableCheck if handler service is running

Setting Up Alerts

Viewing metrics manually is reactive. Alerts make monitoring proactive. Azure Monitor fires an alert when a metric crosses a threshold.

Useful Alert Rules for Event Grid

Alert 1: High Delivery Failure Rate
+---------------------------------+
| Metric:  Delivery Failed Events |
| Operator: Greater Than          |
| Threshold: 10 per 5 minutes     |
| Action: Email + Slack webhook   |
+---------------------------------+

Alert 2: Dead Letter Events Growing
+---------------------------------+
| Metric:  Dead Lettered Events   |
| Operator: Greater Than          |
| Threshold: 1 per 5 minutes      |
| Action: PagerDuty notification  |
+---------------------------------+

Alert 3: No Events Published
+---------------------------------+
| Metric:  Published Events       |
| Operator: Less Than             |
| Threshold: 1 per 30 minutes     |
| Action: Email alert             |
| (detects silent source failure) |
+---------------------------------+

Monitoring with Azure Event Grid Health

Azure Service Health shows platform-level incidents. If Event Grid itself has an outage in a region, Service Health reports it. Always check Service Health before assuming your application code has a bug.

Access it at: Azure Portal → Service Health → Service Issues → Filter by Event Grid

End-to-End Monitoring Diagram

Event Source
    |
    | Publishes event
    v
+-------------------+         Azure Monitor
|   Event Grid      |-------> Published Events metric
|   Topic           |
+--------+----------+
         |
         | Routes to subscriptions
         v
+-------------------+         Azure Monitor
|   Subscription    |-------> Matched Events metric
|   Filters Applied |
+--------+----------+
         |
         | Delivers to handler
         v
+-------------------+         Azure Monitor
|   Handler         |-------> Delivered Events metric
|   (Function,      |         Delivery Failed Events metric
|    Logic App,     |
|    Webhook)       |
+-------------------+
         |
         | On repeated failure
         v
+-------------------+
|   Dead Letter     |-------> Dead Lettered Events metric
|   Storage         |         + Diagnostic Logs
+-------------------+

Best Practices for Event Grid Monitoring

PracticeBenefit
Always enable diagnostic logs for production topicsProvides full visibility into failures
Use Log Analytics for log destinationEnables powerful KQL queries
Set alerts on Delivery Failed EventsCatch broken handlers immediately
Set alerts on Dead Lettered EventsDetect events that exhaust retry budget
Monitor Published Events for source healthDetect silent failures in event producers
Build a dashboard in Azure Monitor WorkbooksSingle view for all Event Grid health signals

Azure Monitor Workbooks for Event Grid

Azure Monitor Workbooks let you build visual dashboards combining metrics and log queries. A good Event Grid workbook includes four panels: published events trend, delivery success rate, failure breakdown by error code, and dead letter count over time.

Access Workbooks at: Azure Portal → Monitor → Workbooks → New

Summary

Monitoring Azure Event Grid means tracking events from publication through delivery and into dead letter storage when things fail. Azure Monitor provides metrics automatically. Diagnostic logs provide detailed failure records in Log Analytics. Alerts turn monitoring from a manual check into an automated notification system. Combining metrics, logs, and alerts gives complete visibility into every event flowing through an Event Grid solution.