IoT & Devices

Check up on your remote fleet: Cloud IoT now makes Device Activity Logging generally available

Embedded systems engineers who develop IoT systems often face a number of challenges. Getting devices connected to the internet for the first time and every time is a tall order in today’s fragmented IoT market. Even the process of determining whether or not a particular device is working properly can be a challenge. Device Activity Logging (or just Logging, for short) allows customers to receive device activity logs from Cloud IoT Core, right in Stackdriver. Cloud IoT Core produces two types of logs: audit logs and now device logs as well. Both are available for viewing in Stackdriver.

activity logs available in IoT Core.png
A view of the device activity logs available in IoT Core, using Stackdriver tools to sort and filter the logs. 

Logging

During development it can be frustrating to understand why a device isn’t connecting as it was designed to, or otherwise behaving as intended. Furthermore, debugging a deployed device or group of devices in a fleet of thousands can be near impossible without the correct instrumentation. Detailed activity logs are usually the only way to understand the lifecycle a specific device has encountered, and many IoT platforms make this information difficult to access.

With Cloud IoT Core, you can now enable device logging for a single device or for an entire fleet. Device Activity Logging allows users to select different log levels, depending on the verbosity of logs they are interested in. Users can choose to see just errors, full connection history, or even a log of every time a device sends a message (note: message content is not logged, only the actual event). Device Activity Logs are written to Stackdriver, which means that they are available alongside all the rest of your GCP (and IoT) audit logs. This makes debugging errors or solving connectivity problems  a snap.

monitoring dashboard.png
An example of what a monitoring dashboard for a small number of devices might look like.

Monitoring

Logs are great for diagnosing problems with devices, but sometimes it’s necessary to understand the health of your entire fleet of devices, with just a quick glance. You can get a good idea of what’s going on within your business just by seeing how many devices are connected and how often they communicate. To meet this need, many businesses will build custom dashboards, or at least employ a simple visualization tool.

The new monitoring tab in IoT Core can help you get a complete picture of your fleet with no additional setup. IoT Core automatically reports this data to Stackdriver Metrics where they can then be queried to create custom dashboards, if you wish. However, we have already created a standard dashboard of the most useful metrics, right in IoT Core.

Simply click on the “Monitoring” tab to see information about how many devices are connected, how many messages they are sending, and how much data they are using. If you need more granular information, you can easily follow the link to Stackdriver Metrics.

Conclusion

To find out more about which events are logged under each logging level, take a look at the documentation. Logging and Monitoring are now generally available, so try enabling it for some of your devices today. If you’d prefer to explore the functionality of Cloud IoT Core in an interactive, educational format, try our Cloud IoT Qwiklab, which includes logging examples.