I've got an Azure function that consumes messages from an Azure Service Bus and publishes messages to an Event Hub for another team to consume regularly. Is there any default/out of the box metrics available on Application Insights/Azure Portal to see if there are messages on the Event Hub that are yet to be consumed by anyone?
-
to see if there are messages on the Event Hub that are yet to be consumed we have add alias data in the Event Hubs Instance. Create an Azure Data Explorer Database and Database.Go to Azure Data Explorer select the Database and run the query using the database name to view dataP Sampath– P Sampath2024-03-26 05:48:24 +00:00Commented Mar 26, 2024 at 5:48
-
@Sampath What want to be able to see this info on an Azure WorkbookBhav– Bhav2024-03-26 09:31:32 +00:00Commented Mar 26, 2024 at 9:31
-
we able see only number of messages in event and outgoing message and there difference shows the number of message sent in Azure Workbook . To see message you need to use Azure Data Explorer Clusters/Stream Analytics jobs and send to other resourceP Sampath– P Sampath2024-03-26 11:04:45 +00:00Commented Mar 26, 2024 at 11:04
1 Answer
The image below shows the default metrics available in Azure Monitor for Azure Event Hubs, such as incoming and outgoing messages, latency, and throughput. These metrics are not directly available in Application Insights.

Incoming messages indicate the number of events in the Event Hub, and outgoing messages indicate the number of messages consumed. Their difference shows the number of messages left.
Other methods:
To monitor metrics related to Azure Event Hub using Azure Application Insights, you can create custom telemetry using the Azure SDK for .NET or other available SDKs. Modify the code to send custom telemetry to Application Insights. You can track events such as message consumption, publishing to Event Hub, and any relevant metrics.
Use custom events or metrics to track the status of messages in the Event Hub. For example, you can track the count of messages published to the Event Hub, the count of messages consumed by other teams, and calculate the delta to identify messages that are yet to be consumed.
Once the custom telemetry is sent to Application Insights, you can query this data using Application Insights Analytics or visualize it using Azure Monitor. You can create queries to analyze message consumption trends, identify patterns, and set up alerts if necessary. Based on your analysis, you can set up alerts in Azure Monitor to notify you when certain conditions are met, such as a high number of messages pending consumption in the Event Hub.
With REST API:
Metrics List with REST API in Azure Monitor
Another way to see events present is to analyze data in the Event Hubs instance using Azure Data Explorer.
