Özgür Demirtaş
Bimar Teknoloji Blog
3 min readAug 2, 2023

--

Error Visualization with Azure Monitor in Hybrid Environments

The projects we are working on may include numerous physical systems in addition to cloud-based resources. These physical systems cannot be monitored in real-time for the health of the applications and services running on them when they go offline.

When “Azure Arc” and “Azure Monitor” are used together, they provide valuable benefits for monitoring both cloud-based and on-premises environments in the corporate setting.

In a hybrid setup like this, where satellite connections are also used, collecting data about the health of our applications and services in remote environments from systems equipped with “Azure Monitor Agent” and accumulating this data in a “Log Analytics Workspace” in the cloud can be the beginning of a comprehensive monitoring strategy.

Log Analytics Workspace is a suitable environment for collecting and analyzing log data not only from “Azure Monitor” but also from other Azure services. It is ideal for gathering and analyzing details related to application, database, network, and system errors in fleet-like environments.

The “Azure Arc” setup for satellite-connected systems in our hybrid environment might appear as follows:

Since we are accumulating data from our application and infrastructure services in a Log Analytics Workspace, we can query application errors that occurred in “Server N” within the last 24 hours using the “Kusto Query Language” as follows:

Event
| where TimeGenerated >= ago(1d)
| where EventLog has "Application"
| where EventLevelName == "Error"
| where RenderedDescription has "WebApi"
| project-rename EventDate = TimeGenerated , HostName = Computer, ErrorMessage = EventData, DetailedErrorInfo =RenderedDescription
| project EventDate, HostName, DetailedErrorInfo , Description = 'App Api Error'

The data set collected under the Workspace can be defined using “Data Collection Rules.” In this example, we can see that one of our data collection rules is for “Application Event Log”.

We might want to visualize the query results. For this purpose, we can apply “Export PowerBI (as an M query)” as shown in the image below to use it in the Power BI environment.

The export process generates a text file containing the query results. When you copy the content of this file into the “Advanced Editor” within the “Transform Data” menu of Power BI Desktop environment, you can transfer the data related to the desired metrics into the BI environment. This allows you to start creating visualizations based on the data, enabling you to analyze the metrics effectively.

At this point, we can add other types of error information to our model as well. By enhancing the data model with additional error data, we can gain a more comprehensive view of the application and infrastructure performance, identify trends, and make more informed decisions :

Now that we are able to collect data from Azure Monitor into a centralized “Log Analytics Workspace”, we have the capability to report and visualize the data in a categorized and metric-based manner :

In summary, using “Azure Arc” and “Azure Monitor” together empowers us to monitor and manage our hybrid environment comprehensively, bridging the gap between cloud-based and on-premises resources and providing a unified monitoring experience.

--

--