Azure Log Analytics integration for Azure IoT Edge metrics

Recently, I have shown how to interact with Prometheus metrics on the edge, provided by the Azure IoT Edge runtime.

The built-in edge Metrics are great for analyzing what is currently going on in the containers (CPU usage, memory usage, restarts, etc) and on the host (CPU usage, disk usage, etc.).

Since then, this metrics solution is expanded with Azure Monitor workbooks in the Azure portal so we are able to show the metrics in dialogs within Log Analytics workbooks.

Microsoft introduces this extra Metrics collector module. It is already available in the Azure IoT Edge Module marketplace.

Note: this Metrics collector support is still in preview.

Today, I will show how this is done using the preferred way:

Azure IoT Edge Metrics are sent directly to Azure Log Analytics.

Doorgaan met het lezen van “Azure Log Analytics integration for Azure IoT Edge metrics”

Deploy Prometheus container with Azure IoT Edge

Once you have set up your Azure IoT edge device and runtime, you want to make sure it keeps running as expected. So you need to start measuring how your device, your modules, and runtime are doing.

Microsoft provides built-in metrics for Azure IoT using endpoints on the EdgeHub and EdgeAgent exposing messages in the Prometheus format.

In a previous blog post, I showed how to access these endpoints and not to send messages containing this information to the cloud using a custom Azure IoT Edge metrics module.

Azure IoT Edge can deploy whatever Docker container you have. So, we can also use the original Prometheus service as a Docker container:

This way you can build a local dashboard using well-known tooling on the edge.

Let’s check out how this works.

Doorgaan met het lezen van “Deploy Prometheus container with Azure IoT Edge”

Azure IoT Edge module metrics in action

We are familiar with the Azure IoT Hub metrics which are offered. The Azure cloud tells us eg. how many messages are received or the number of devices that are connected.

If we look at Azure IoT Edge, you had to collect your own made metrics in the past.

Because IoT Edge modules are Docker containers and therefore sandboxed, you had to rely on the (third-party) logic to capture Host metrics. Regarding metrics about the edge agent and hub, these were not available.

Until now.

With the most recent IoT Edge runtimes, agent, and hub, we have access to Edge metrics.

Both the Agent and Hub module expose the metrics over HTTP endpoints:

Within the Moby runtime, port 9600 is exposed on both individual modules. Outside the runtime, we have to assign individual host ports to prevent using the same host port.

Let’s see how this looks like and how we can harvest metrics in a custom container.

Doorgaan met het lezen van “Azure IoT Edge module metrics in action”

How to fix your StreamAnalytics metrics monitoring

Today it became clear to me that I was missing something…

Every time I created a new StreamAnalytics job, and data arrived, I was staring at this monitoring windows saying: “No available data”:



Today I finally decided to check this out. And I found out it’s a simple thing to fix. And it can be a real asset.

Doorgaan met het lezen van “How to fix your StreamAnalytics metrics monitoring”