Requirements
nerves_hub_link2.13.0 or later. The extension is not in the default extension list.- NervesHub 2.5.0 or later.
- ClickHouse on the instance. Without it, NervesHub does not offer the extension to devices. See Feature prerequisites.
Enable it
1
Add Error reports to your firmware
Name the module in
extension_modules:2
Turn it on for the product
In Product settings, on the General tab, switch on Error reports in the Device extensions card. A product created in the web UI starts with every extension on. A product created through the API or
nh starts with every extension off.3
Check the device setting
On the device’s Settings tab, Error Reports in the Extensions card is on by default.
Check that it works
Reconnect the device if it was connected before you turned the extension on. Then report a test error from the device’s console:What counts as an error
Anything the runtime attaches acrash_reason to:
- A process dying from an exception, an exit or a throw.
- A GenServer terminating abnormally.
- A failed
Task. - A
Logger.error(message, crash_reason: {exception, stacktrace})call in your own code.
:error. Most of those are text, with no stacktrace to group by.
Reports are collected from application start, not from the moment the extension attaches. A crash during boot, or while the device is offline, is sent once there is a connection.
Report an error you handled
Crashes report themselves. UseNervesHubLink.report_error/3 for an error your code rescued and still wants counted:
The function returns
:ok whether or not the extension is running.
How errors are grouped
NervesHub groups occurrences by the kind of error, the reason with per-occurrence detail such as pids removed, and the top three stack frames. Line numbers are ignored, so an issue does not split when unrelated code above it changes. Use:group when your application knows something the stacktrace does not. Every failure in a payment integration might arrive through one HTTP client function. A group of your own wins outright.
Attach device state
Every report carries the device’s uptime asuptime_ms. To add more to every report, point context at a function that returns a map:
uptime_ms, free_memory_bytes and reboot_count labels and units. Other keys are shown as they arrive. NervesHub keeps at most 32 context keys and 512 bytes per value, and redacts values under keys that look like credentials.
NervesHub fills in the firmware UUID from the device’s connection.
Buffering and limits
- The buffer drops the oldest reports past
max_reports. What it dropped is reported as an error of its own. - A message carries at most 25 reports. A flush with more splits into several messages.
- Reasons are cut at 2KB and messages at 8KB. A stacktrace is trimmed past 30 frames.
- NervesHub accepts one message per second per device, with a burst of five. A message over the limit is dropped.
Work with issues in NervesHub
The product’s Errors page lists issues under Unresolved, Muted and Resolved. You can search error messages and stack frames.- Resolve an issue when you have shipped a fix. Any occurrence after you resolve reopens it and marks it as regressed, including one from a device still on the old firmware.
- Mute an issue you know about and do not want in the queue. A muted issue keeps counting and does not reopen.
- Reopen and Unmute move an issue back to Unresolved.

