4

We have been trying monitor consumer lag on Event Hub partitions.

I have looked in the azure portal and the Event Hub Api's but so far found nothing.

Was wondering if anyone has tried this and if so could you point me in the right direction.

Thanks.

Chimmy
  • 157
  • 2
  • 10

3 Answers3

5

You can compare the Message Sequence of the current message being processed, against the last sequence number of the message received for a partition. The difference between these numbers is 'how far behind' the latest message your processing has fallen. To get the details of the last message received in a partition, you need to access a PartitionContext object.

How I've implemented this is with Azure Function and a Custom Metric in Application Insights. As a batch of messages is received, I calculate the difference between the values and write the metric, which allows me to track this in Grafana and raise alerts when required.

I wrote a medium article on how to achieve this here - https://medium.com/@dylanm_asos/azure-functions-event-hub-processing-8a3f39d2cd0f

Dylan Morley
  • 1,656
  • 12
  • 21
  • I also wrote an article about this with code samples in Typescript: https://xebia.com/blog/monitoring-consumer-lag-in-azure-event-hub/ – 0xR Oct 14 '21 at 12:12
1

As per my knowledge, there is no option to monitor Azure Event Hub consumer lag.

These are the supported metrics for Azure Event Hub.

For more details, refer “Azure Event Hubs metrics in Azure Monitor”.

Hope this helps.

CHEEKATLAPRADEEP
  • 12,191
  • 1
  • 19
  • 42
0

As per my knowledge, Azure Eventhub support Consumer lag log: https://learn.microsoft.com/en-us/azure/event-hubs/monitor-event-hubs-reference#application-metrics-logs

But only available in premium and dedicated tiers. []

makhdumi
  • 1,308
  • 11
  • 35