Developers Guide
Effective monitoring is crucial for understanding the health, performance, and usage patterns of your Azure Event Hubs. This guide outlines key metrics, tools, and best practices for monitoring your Event Hubs instances.
Azure Event Hubs provides a rich set of metrics that you can access through Azure Monitor. Focus on the following categories:
Incoming Requests: Number of requests to Event Hubs.Outgoing Requests: Number of responses from Event Hubs.Bytes In/Out: Amount of data sent to and received from Event Hubs.Message Throughput: Number of messages sent and received.Incoming Request Latency: Time taken to process incoming requests.Outgoing Request Latency: Time taken to process outgoing requests.Server Errors: Number of 5xx errors.Client Errors: Number of 4xx errors.Throttled Requests: Number of requests that were throttled due to exceeding capacity limits.Total Connections: Current number of active connections.Capture Operations Succeeded/Failed: Success rate of Event Hubs Capture.Azure Monitor is the primary tool for collecting, analyzing, and acting on telemetry from your Azure resources. Event Hubs integrates seamlessly with Azure Monitor.
Visualize metrics in real-time, set up alerts, and analyze trends over time.
Access: Azure Portal -> Your Event Hubs Namespace -> Metrics
Key Views:
Enable diagnostic settings to send detailed logs to Log Analytics, Storage Accounts, or Event Hubs. This is crucial for in-depth troubleshooting.
Access: Azure Portal -> Your Event Hubs Namespace -> Diagnostic settings
Key Log Categories:
Application_Read: Logs for consumer applications reading from Event Hubs.Application_Write: Logs for producer applications writing to Event Hubs.Archive_Service: Logs related to Event Hubs Capture.With Log Analytics, you can use Kusto Query Language (KQL) for powerful log analysis:
AzureMetrics
| where ResourceProvider == "MICROSOFT.EVENTHUB" and MetricName == "IncomingRequests"
| summarize sum(MetricValue) by bin(TimeGenerated, 1h), Resource
| render timechart
Configure alerts to proactively notify you of critical conditions.
Access: Azure Portal -> Monitor -> Alerts -> Create Alert Rule
Recommended Alerts:
Server Errors (5xx).Client Errors (4xx).Throttled Requests.Bytes In/Out or Message Throughput.Incoming Request Latency.Azure Advisor provides personalized recommendations to optimize your Azure resources. It can offer suggestions related to performance and cost for Event Hubs.
Tip: Consider implementing distributed tracing for your Event Hubs producers and consumers to gain visibility into the entire event pipeline.