MCU Built-in Metrics
The Memfault SDK automatically collects a number of metrics without any additional code. This page lists all built-in metrics by platform.
For information on defining your own custom metrics, see the MCU Metrics documentation.
Core Metrics
These metrics are collected on all supported platforms.
Always Collected
| Metric | Units | Description | Notes |
|---|---|---|---|
MemfaultSdkMetric_IntervalMs | ms | Duration of the heartbeat interval | e.g. 3600000; default interval is 1 hour |
MemfaultSdkMetric_UnexpectedRebootCount | count | Unexpected reboots since the last heartbeat | e.g. 0; non-zero values indicate unexpected reboots |
operational_hours | hours | Operational hours accumulated since the last heartbeat | e.g. 1; increments each heartbeat interval |
operational_crashfree_hours | hours | Crash-free operational hours since the last heartbeat | e.g. 1; resets to 0 after a crash |
Conditionally Collected
The following core metrics are enabled by setting the corresponding macro in
memfault_platform_config.h:
| Metric | Units | Description | Enable macro | Notes |
|---|---|---|---|---|
sync_successful | count | Successful syncs | MEMFAULT_METRICS_SYNC_SUCCESS 1 | |
sync_failure | count | Failed syncs | MEMFAULT_METRICS_SYNC_SUCCESS 1 | |
sync_memfault_successful | count | Successful Memfault syncs | MEMFAULT_METRICS_MEMFAULT_SYNC_SUCCESS 1 | |
sync_memfault_failure | count | Failed Memfault syncs | MEMFAULT_METRICS_MEMFAULT_SYNC_SUCCESS 1 | |
connectivity_connected_time_ms | ms | Time connected to the network | MEMFAULT_METRICS_CONNECTIVITY_CONNECTED_TIME 1 | e.g. 3540000 for ~59 min in a 1-hour interval |
connectivity_expected_time_ms | ms | Time the device was expected to be connected | MEMFAULT_METRICS_CONNECTIVITY_CONNECTED_TIME 1 | Compare with connectivity_connected_time_ms to compute uptime ratio |
battery_soc_pct_drop | % | Battery state-of-charge drop since the last heartbeat | MEMFAULT_METRICS_BATTERY_ENABLE 1 | e.g. 5; use with battery_discharge_duration_ms for drain rate |
battery_discharge_duration_ms | ms | Duration of battery discharge | MEMFAULT_METRICS_BATTERY_ENABLE 1 | Excludes time spent charging |
battery_soc_pct | % | Current battery state of charge | MEMFAULT_METRICS_BATTERY_ENABLE 1 | e.g. 82 |
MemfaultSDKMetric_log_dropped_lines | count | Log lines dropped since the last heartbeat | MEMFAULT_METRICS_LOGS_ENABLE 1 | Non-zero indicates log buffer pressure |
MemfaultSDKMetric_log_recorded_lines | count | Log lines recorded since the last heartbeat | MEMFAULT_METRICS_LOGS_ENABLE 1 | |
uptime_s | s | Device uptime | MEMFAULT_METRICS_UPTIME_ENABLE 1 | Monotonically increasing since last POR |
The Battery and Connectivity core metrics are also available on all platforms when enabled. See the Core Metrics documentation for details.
Backend-Injected Metrics
These metrics are injected by the Memfault backend during event processing and require no device-side code changes.
From ELF / Symbol File
These metrics are populated from the uploaded symbol file.
| Metric | Description | Platform | Example |
|---|---|---|---|
MemfaultSdkMetric_sdk_version | Memfault SDK version | All MCU | 1.11.0 |
MemfaultSdkMetric_os_name | Operating system name | All MCU | zephyr, esp-idf |
MemfaultSdkMetric_os_version | Operating system version | All MCU | 3.7.0 |
MemfaultSdkMetric_soc_name | SOC part name | Zephyr only | NRF9160, NRF5340 |
From Device Metrics
These metrics are derived from other device-reported metrics during event processing.
| Metric | Description | Platform | Derived from | Example |
|---|---|---|---|---|
wifi_ap_oui_vendor | Wi-Fi AP manufacturer name | Zephyr, ESP-IDF | wifi_ap_oui | Apple, Inc. |
bt_connection_remote_info_version | Bluetooth version of the remote device | Zephyr, NCS | bt_connection_remote_info | 5.2 |
bt_connection_remote_info_vendor | Manufacturer of the remote Bluetooth device | Zephyr, NCS | bt_connection_remote_info | Nordic Semiconductor ASA |
From HTTP User-Agent
When a device uploads data, the HTTP User-Agent header is parsed and stored as
metrics. These are useful for companion-app scenarios where a mobile app proxies
device data.
| Metric | Description | Example |
|---|---|---|
MemfaultSdkMetric_last_seen_user_agent | Raw HTTP User-Agent string | MemfaultSDK/1.11.0 (Zephyr) |
MemfaultSdkMetric_last_seen_user_agent_os | OS family and version combined | Android (13.0) |
MemfaultSdkMetric_last_seen_user_agent_os_family | OS family | Android |
MemfaultSdkMetric_last_seen_user_agent_os_version | OS version string | 13.0 |
MemfaultSdkMetric_last_seen_user_agent_device | Device family or model | Pixel 6 |
FreeRTOS
These metrics are available on FreeRTOS-based platforms. To use them, add the
Memfault FreeRTOS port files from
ports/freertos/
to your project and include the built-in metric definitions in your
memfault_metrics_heartbeat_config.def:
#include "ports/freertos/config/memfault_metrics_heartbeat_freertos_config.def"
ESP-IDF users get these automatically when
CONFIG_MEMFAULT_FREERTOS_TASK_RUNTIME_STATS=y.
| Metric | Units | Description | Condition | Notes |
|---|---|---|---|---|
cpu_usage_pct | % (÷100) | CPU usage percentage | Always when port is included | e.g. 4500 = 45.00% |
cpu1_usage_pct | % (÷100) | Core 1 CPU usage percentage | MEMFAULT_FREERTOS_RUNTIME_STATS_MULTI_CORE_SPLIT 1 | Dual-core ESP32 etc. |
timer_task_stack_free_bytes | bytes | Free bytes in the FreeRTOS timer task stack | MEMFAULT_FREERTOS_COLLECT_TIMER_STACK_FREE_BYTES 1 | e.g. 512; low values may indicate stack overflow risk |
memory_idle_pct_max | % | Peak idle task stack usage | MEMFAULT_METRICS_THREADS_DEFAULTS 1 | |
memory_tmr_svc_pct_max | % | Peak timer service task stack usage | MEMFAULT_METRICS_THREADS_DEFAULTS 1 |
Zephyr
Zephyr built-in metrics are organized by the Kconfig option that enables them.
Use menuconfig to explore available options under the MEMFAULT submenu.
Default Metrics
CONFIG_MEMFAULT_METRICS_DEFAULT_SET_ENABLE=y to enable.
| Metric | Units | Description | Additional requirement | Notes |
|---|---|---|---|---|
cpu_usage_pct | % (÷100) | Total CPU active percentage | CONFIG_THREAD_RUNTIME_STATS=y, Zephyr ≥ 3.0 | e.g. 4500 = 45.00% |
TimerTaskCpuUsage | % | CPU usage of the timer task | CONFIG_THREAD_RUNTIME_STATS=y | Raw permille value |
AllTasksCpuUsage | % | Aggregate CPU usage across all tasks | CONFIG_THREAD_RUNTIME_STATS=y | |
TimerTaskFreeStack | bytes | Free stack bytes for the timer task | CONFIG_THREAD_STACK_INFO=y | e.g. 384; low values may indicate stack overflow risk |
FileSystem_BytesFree | bytes | Free bytes in the filesystem | CONFIG_MEMFAULT_FS_BYTES_FREE_METRIC=y |
Networking
CONFIG_MEMFAULT_METRICS_TCP_IP=y to enable.
| Metric | Units | Description | Additional requirement | Notes |
|---|---|---|---|---|
net_bytes_received | bytes | Total bytes received | - | |
net_bytes_sent | bytes | Total bytes sent | - | |
net_tcp_recv | count | TCP packets received | CONFIG_NET_STATISTICS_TCP=y | |
net_tcp_sent | count | TCP packets sent | CONFIG_NET_STATISTICS_TCP=y | |
net_udp_recv | count | UDP packets received | CONFIG_NET_STATISTICS_UDP=y | |
net_udp_sent | count | UDP packets sent | CONFIG_NET_STATISTICS_UDP=y |
Wi-Fi
CONFIG_MEMFAULT_METRICS_WIFI=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
wifi_connected_time_ms | ms | Time connected to Wi-Fi | 3540000 | Used to assess connection stability |
wifi_disconnect_count | count | Wi-Fi disconnect count | 2 | Can help identify roaming or signal loss |
wifi_standard_version | - | Wi-Fi standard | 802.11n | 802.11b/g/n/ac/ax |
wifi_security_type | - | Security type | WPA2-PSK | Open, WPA2-PSK, WPA3, etc. |
wifi_frequency_band | - | Frequency band | 2.4 | 2.4 or 5 |
wifi_primary_channel | channel | Primary channel ID | 6 | 1-11 (2.4 GHz), 36+ (5 GHz) |
wifi_sta_rssi | dBm | Station RSSI | -65 | > -70 dBm is generally good |
wifi_beacon_interval | TU (1.024 ms) | Beacon interval | 100 | Typical values: 100 or 102 TU |
wifi_dtim_interval | beacon periods | DTIM interval | 3 | Higher DTIM reduces wake-ups; improves battery at cost of latency |
wifi_twt_capable | boolean | TWT (Target Wake Time) capable | 1 | Power-saving feature introduced in 802.11ax |
wifi_tx_rate_mbps | Mbps | TX rate | 72 | Varies dynamically with signal quality and AP capabilities |
wifi_ap_oui | - | OUI of the associated access point | 00:1A:2B | Vendor identifier extracted from AP MAC |
Bluetooth
CONFIG_MEMFAULT_METRICS_BLUETOOTH=y to enable.
| Metric | Units | Description | Additional requirement | Notes |
|---|---|---|---|---|
bt_gatt_mtu_size | octets | GATT MTU size | - | e.g. 247; default is 23; higher = more efficient transfers |
bt_connection_remote_info | - | Remote info: [version]:[mfr id].[subversion] | CONFIG_BT_REMOTE_VERSION=y | e.g. 0a:0059.0000 |
bt_connection_event_count | count | Connection event count | - | |
bt_connection_interval_us | µs | Connection interval | - | e.g. 45000 (45 ms); range 7.5 ms - 4 s |
bt_connection_latency | intervals | Connection latency | - | Number of intervals the peripheral can skip |
bt_connection_timeout | 10 ms | Supervision timeout | - | e.g. 400 = 4 s; connection dropped if no packet received in this window |
bt_connection_rssi | dBm | Connection RSSI | CONFIG_BT_CTLR_CONN_RSSI=y | e.g. -55; > -70 dBm is generally good |
bt_connected_time_ms | ms | Time connected | - | |
bt_disconnect_count | count | Disconnect count | - |
CPU Temperature
CONFIG_MEMFAULT_METRICS_CPU_TEMP=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
thermal_cpu_c | °C (÷10) | CPU temperature | 27.5 |
Memory
CONFIG_MEMFAULT_METRICS_MEMORY_USAGE=y to enable.
| Metric | Units | Description | Additional requirement | Notes |
|---|---|---|---|---|
memory_pct_max | % (÷100) | Peak heap utilization since last heartbeat | Zephyr ≥ 3.0 | e.g. 4800 = 48.00% |
Heap_BytesFree | bytes | Free bytes in the heap | - | e.g. 28672 |
Thread Stack Defaults
CONFIG_MEMFAULT_METRICS_THREADS_DEFAULTS=y to enable.
| Metric | Units | Description | Additional requirement | Notes |
|---|---|---|---|---|
memory_idle_pct_max | % | Peak idle thread stack usage | - | High values (near 100%) indicate near stack overflow |
memory_sysworkq_pct_max | % | Peak system work queue stack usage | - | |
memory_mflt_upload_pct_max | % | Peak Memfault upload thread stack usage | CONFIG_MEMFAULT_PERIODIC_UPLOAD_USE_DEDICATED_WORKQUEUE=y |
Boot Time
CONFIG_MEMFAULT_METRICS_BOOT_TIME=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
boot_time_ms | ms | Boot time | 1250 | Time from reset to application ready |
ESP-IDF
ESP-IDF built-in metrics are enabled via idf.py menuconfig under the
Component config → Memfault submenu.
Memory
CONFIG_MEMFAULT_METRICS_MEMORY_USAGE=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
heap_free_bytes | bytes | Free bytes in the heap | 204800 | Current free heap |
heap_largest_free_block_bytes | bytes | Largest contiguous free block in the heap | 131072 | Low values may indicate heap fragmentation |
heap_allocated_blocks_count | count | Number of currently allocated heap blocks | 127 | |
heap_min_free_bytes | bytes | Minimum free bytes ever in the heap | 98304 | High water mark since boot; indicates worst-case memory pressure |
memory_pct_max | % (÷100) | Peak heap utilization since last heartbeat | 6200 | Divide by 100 for percentage: 62.00% |
Wi-Fi
CONFIG_MEMFAULT_ESP_WIFI_METRICS=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
wifi_connected_time_ms | ms | Time connected to Wi-Fi | 3540000 | Used to assess connection stability |
wifi_sta_min_rssi | dBm | Minimum observed station RSSI | -72 | Worst-case signal during the interval; > -70 dBm is generally good |
wifi_primary_channel | channel | Primary channel ID | 6 | 1-11 (2.4 GHz), 36+ (5 GHz) |
wifi_security_type | - | Security type | WPA2_PSK | Open, WPA2_PSK, WPA3_PSK, etc. |
wifi_standard_version | - | Wi-Fi standard | 802.11n | 802.11b/g/n/ac/ax |
wifi_disconnect_count | count | Disconnect count | 1 | Can help identify roaming or signal loss |
wifi_ap_oui | - | OUI of the associated access point | 00:1A:2B | Vendor identifier extracted from AP MAC |
CPU Temperature
CONFIG_MEMFAULT_METRICS_CPU_TEMP=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
thermal_cpu_c | °C (÷10) | CPU temperature | 452 | Divide by 10 for degrees Celsius: 45.2 °C |
CPU temperature is not supported on the original ESP32.
Chip Info
CONFIG_MEMFAULT_METRICS_CHIP_ENABLE=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
flash_spi_manufacturer_id | - | 24-bit RDID of the SPI flash chip | c84017 | c84017 = GigaDevice GD25Q64 8 MiB |
flash_spi_total_size_bytes | bytes | Total SPI flash size | 8388608 | 8 MiB |
esp_chip_revision | - | Chip model and revision | esp32s3-0.2 |
Network I/O
CONFIG_MEMFAULT_METRICS_NETWORK_IO=y to enable.
Requires ESP-IDF ≥ 5.4.0.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
network_rx_bytes | bytes | Total bytes received over the network | 1048576 | |
network_tx_bytes | bytes | Total bytes transmitted over the network | 524288 |
Boot Time
CONFIG_MEMFAULT_METRICS_BOOT_TIME=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
boot_time_ms | ms | Boot time | 2100 | Time from reset to application ready |
Flash Wear
CONFIG_MEMFAULT_METRICS_FLASH_ENABLE=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
flash_spi_write_bytes | bytes | Total bytes written to SPI flash | 4096 | Typical minimum write is one 4 KiB sector |
flash_spi_erase_bytes | bytes | Total bytes erased on SPI flash | 4096 | Flash must be erased before writing |
Deep Sleep
CONFIG_MEMFAULT_DEEP_SLEEP_SUPPORT=y to enable.
These metrics are enabled automatically when
CONFIG_MEMFAULT_DEEP_SLEEP_SUPPORT=y and can be individually disabled with
CONFIG_MEMFAULT_DEEP_SLEEP_METRICS=n.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
deep_sleep_time_ms | ms | Time spent in deep sleep | 55800000 | e.g. ~15.5 hours; use with active_time_ms to compute duty cycle |
deep_sleep_wakeup_count | count | Number of deep sleep wakeups | 42 | |
active_time_ms | ms | Time spent out of deep sleep | 600000 |
FreeRTOS Task Runtime
CONFIG_MEMFAULT_FREERTOS_TASK_RUNTIME_STATS=y to enable.
See FreeRTOS metrics above. Enabled on ESP-IDF via
CONFIG_MEMFAULT_FREERTOS_TASK_RUNTIME_STATS=y.
LwIP
CONFIG_MEMFAULT_LWIP_METRICS=y to enable.
Requires TCP_STATS and/or UDP_STATS to be enabled in your LwIP config.
| Metric | Units | Description | LwIP requirement | Notes |
|---|---|---|---|---|
tcp_tx_count | count | TCP packets sent | TCP_STATS 1 | |
tcp_rx_count | count | TCP packets received | TCP_STATS 1 | |
tcp_drop_count | count | TCP packets dropped | TCP_STATS 1 | Non-zero may indicate network congestion |
udp_tx_count | count | UDP packets sent | UDP_STATS 1 | |
udp_rx_count | count | UDP packets received | UDP_STATS 1 | |
udp_drop_count | count | UDP packets dropped | UDP_STATS 1 | Non-zero may indicate network congestion |
MbedTLS
CONFIG_MEMFAULT_MBEDTLS_METRICS=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
mbedtls_mem_used_bytes | bytes | Current bytes allocated by mbedTLS | 12288 | |
mbedtls_mem_max_bytes | bytes | Maximum bytes ever allocated by mbedTLS | 36864 | Peak typically occurs during TLS handshake |
nRF Connect SDK (NCS)
NCS built-in metrics are defined in the Nordic SDK repository (not the Memfault SDK). The Memfault SDK provides the collection implementations. The source of truth for the metric definitions is:
nRF91 Series - LTE
CONFIG_MEMFAULT_NCS_LTE_METRICS=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
ncs_lte_time_to_connect_ms | ms | Time to connect to the LTE network | 3200 | High values may indicate poor coverage or network congestion |
ncs_lte_connection_loss_count | count | Number of connection lost events | 1 | |
ncs_lte_psm_tau_seconds | s | Assigned PSM tracking area update (TAU) timer | 3600 | |
ncs_lte_psm_active_time_seconds | s | Active time for PSM | 10 | Time modem stays awake after transmitting |
ncs_lte_edrx_interval_ms | ms | Assigned eDRX interval | 5120 | |
ncs_lte_edrx_ptw_ms | ms | Assigned eDRX paging time window (PTW) | 1280 | |
ncs_lte_mode | - | LTE mode | 7 | 0 = None, 7 = LTE-M, 9 = NB-IoT |
ncs_lte_on_time_ms | ms | Time the modem is on | 360000 | |
ncs_lte_reset_loop_detected_count | count | Times the modem detected a reset loop on the host | 0 | Non-zero: modem blocks network attaches for 30 min |
ncs_lte_modem_fw_version | - | Modem firmware version | nrf9160_1.3.5 | |
ncs_lte_operator | - | Network operator | AT&T | |
ncs_lte_snr_decibels | dB | Signal-to-noise ratio | 15 | Higher is better |
ncs_lte_rsrp_dbm | dBm | Reference signal received power | -95 | -70 to -80 dBm is good; below -100 dBm is poor |
ncs_lte_tx_kilobytes | kB | Kilobytes transmitted via the modem | 12 | |
ncs_lte_rx_kilobytes | kB | Kilobytes received via the modem | 24 | |
ncs_lte_band | - | Assigned frequency band (3GPP enumeration) | 2 | Maps to 3GPP frequency band; see LTE band reference |
nRF91 Series - Stack
CONFIG_MEMFAULT_NCS_STACK_METRICS=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
ncs_connection_poll_unused_stack | bytes | Free stack bytes in the LTE connection poll thread | 512 | Low values may indicate stack overflow risk |
nRF52 / nRF53 / nRF54 Series - Bluetooth
CONFIG_MEMFAULT_NCS_BT_METRICS=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
ncs_bt_connection_time_ms | ms | Total Bluetooth connected time | 3540000 | |
ncs_bt_connection_count | count | Number of Bluetooth connections | 3 | |
ncs_bt_bond_count | count | Number of Bluetooth bonds | 1 | Persistent across resets |
nRF52 / nRF53 / nRF54 Series - Stack
CONFIG_MEMFAULT_NCS_STACK_METRICS=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
ncs_bt_rx_unused_stack | bytes | Free stack bytes in the Bluetooth RX thread | 256 | Low values may indicate stack overflow risk |
ncs_bt_tx_unused_stack | bytes | Free stack bytes in the Bluetooth TX thread | 384 | Low values may indicate stack overflow risk |
npm13xx Battery
CONFIG_MEMFAULT_NRF_PLATFORM_BATTERY_NPM13XX=y to enable.
| Metric | Units | Description | Example | Notes |
|---|---|---|---|---|
battery_voltage | V (÷1000) | Battery voltage | 3750 | Divide by 1000 for volts: 3.75 V |