---
title: How to view metrics
description: This page explains how to view metrics
tags: iot iot-hub metrics
dates:
  validation: 2025-07-16
  posted: 2019-10-01
  validation_frequency: 12
---
import Requirements from '@macros/iam/requirements.mdx'

import image from './assets/scaleway-iothub_metrics_hub.webp'


Metrics reports the usage of your IoT Hub and devices.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- [Created an IoT Hub](/iot-hub/how-to/create-hub/)

## How to view hub metrics

1. Click **IoT Hub** in the **Integration Services** section of the side menu. The list of your IoT Hubs displays.
2. Click the name of the IoT Hub you want to view. The hub's overview page displays.
3. Click the **Metrics** tab of your hub.
    The metrics of the Hub are visualized as graph:

    <Lightbox image={image} alt="" />

## How to view device metrics

1. Click **IoT Hub** in the **Integration Services** section of the side menu. The list of your IoT Hubs displays.
2. Click the name of the IoT Hub you want to view. The hub's overview page displays.
3. Click the **Devices** tab of your hub.
4. Click the device name to open the **Device information** view, which includes a device metrics section.

<Message type="tip">
  Clicking anywhere else than on the device name on the device line will display a quick metrics overview. Bear in mind that the overview is limited to the last 24-hour period.
</Message>

## How to read metrics

The following metrics are available on IoT Hub:

- **Message count**: how many messages a hub / device sent / received
- **Device activity**: when a device was seen connected
- **Active devices**: how many hub devices were connected

### How to read message count metrics

* **Message count** as a **Device metric** is the number of messages exchanged between the hub and the device during the period,
* **Message count** as a **Hub metric** is the sum of all messages exchanged during the period.

Any kind of MQTT packet (`CONNECT`, `PUBLISH`, `SUBSCRIBE`, `PING`, etc.) in any direction (sent or received) is counted as one message.

Examples:
```txt no-copy
Device1 connects & publish a message with qos1

	Device1    CONNECT ->    Hub
	        <- CONNACK
	           PUBLISH ->
	        <- PUBACK

This counts as 4 messages for Device1.
This message is distributed to Device2 and Device3 (with Qos1)

	Hub    PUBLISH -> Device2
	    <- PUBACK
	       PUBLISH -> Device3
	    <- PUBACK

This counts as 4 messages.
So in total 8 messages transited through the IoT Hub.
```

Note that this metric is different from the number of billed messages each month, which also depends on message size.

### How to read device activity and active devices metrics

The device activity metric shows when a particular device was connected to a hub. The active device metric aggregates all the device activity metrics of that hub to show how many devices were connected at the same time.

* **Device activity**: this **Device metric** shows when a device was connected to your hub. A device is shown as active during a time interval (which are represented by bars on the graph), if it was *at least* connected during a *part* of it. This means that the device does not have to be connected during the whole time to be shown as active.
* **Active devices**: this **Hub metric** is the number of **distinct** devices seen connected to your hub during the period. Again, for each time interval, a device does not need to stay connected during the whole interval to be counted as active.

A device is flagged as connected as soon as the hub receives a valid `CONNECT` packet and accepts it. It is flagged disconnected after its connection has been closed.

On the Scaleway console, the device active state is represented with a green positive bar, while an inactive state will be represented by a red negative bar.

Examples:
```txt no-copy
Device1 connects at 9:10am, disconnects at 9:11am.
- In **Last 60 min** period, it will be counted as active for *9:10am* and *9:11am* bars.
- In **Last 24 hours** period, it will be counted as active for *9:00am* bar.

Device2 connects at 9:11am, disconnects at 10:31am.
- In **Last 60 min** period, it will be counted as active for *9:11am* to *10:31am* bars.
- In **Last 24 hours** period, it will be counted as active for *9:00am* and *10:00am* bars.
```

### How to read timescale metrics

For each metric you can choose between 5 timescales:

1. **Last 60 min**: values from one hour ago to the last minute, aggregated **per minute**,
2. **Last 24 hours**: values from 24 hours ago to last hour, aggregated **per hour**,
3. **Last 7 days**: values from seven days ago to last day quarter, aggregated **per 6 hours**,
4. **Last 30 days**: values from 30 days ago to yesterday, aggregated **per day**,
5. **Last 365 days**: values from 365 days ago to last 30 days, aggregated per **calendar month** (the real number of days of each month is used for this time period)


