New release: Activity logging

Trondheim, 2024-04-24

New Span release - activity logging

This release is mostly small bug fixes and improvements but with one major feature: Activity logging for devices and clients. The API is unchanged from the previous version but with a few additions.

Activity logging

Activity logs show client and device activity in the system, typically when something connects, requests information and so on. Debugging connectivity issues can be (or rather is) a frustrating experience:

  • Are we connected at all?
  • Are there any configuration issues?
  • Is my device doing the requests I’m expecting?
  • Is my client connecting properly to the service?
  • What is my gateway doing?

You can turn on activity tracing in the dashboard by clicking on “Activity” in a collection. Click on “Start recording” to record the activities. You can have multiple recordings running at the same time.

Activity recording in dashboard

Do note that the recordings are done only locally, ie in your browser. Once you refresh the page they are removed. If you want to store the activity logs locally (or prefer the command line) you can use the (Span CLI)[https://github.com/lab5e/spancli].

How it works

The acitvity log is quite simple - open a web socket to the activity log and you’ll receive updates. There’s no focus on reliable delivery (it’s using a web socket) so it is best suited to debugging and diagnostics, not for production use.

What kind of events to expect

This version is the initial version and we’ll most likely add more events in future versions, including more events from the data routers. Currently we emit the following events:

Event  Description
imeiMismatch  An IMEI mis-configuration is detected on a device that is trying to connect. This typically happen if you configure both IMSI and IMEI on a device and move the SIM card to a new device. Clear the IMSI field from the old device to fix the error.
imsiMismatch  An IMSI mis-configuraiton is detected on a device that is trying to connect. This typically happens if you switch the SIM card on a device and attempts to reconnect. Clear the IMSI field or replace it with the new value.
ciotConnect A device has authenticated on the mobile network. When it connects to the network it is online but has not attempted to connect to Span yet.
clientConnected  A device has connected to Span, either via the UDP interface, the CoAP interfaces or the DTLS interface
clientDisconnected A device has disconnected from Span. This event typically only appears for devices that connect via the Internet
upstreamMessage A device has sent a message to Span, either via the Internet or the mobile network
downstreamMessage  A message is sent to a device
firmwareRequested A device has requested to download a firmwware image
firmwareCheck  A device has reported its firmware version
firmwareUpdateRequired  Span has detected that the device needs a new firmware version
  firmwareCurrent  The device has reported its version and it’s up to date
firmwareStateChange The firmware state field has changed. This is emitted multiple times while the device is updating its firmware
blobUpload A device has uploaded a new blob
deviceCreated  A device is created via the API
deviceUpdated A device is updated via the API
deviceRemoved  A device is removed via the API
 deviceMoved  A device is moved from one collection to another
gatewayConnected A gateway has connected to the gateway API endpoint
gatewayDisconnected  A gateway has disconnected from the gateway API endpoint
gatewayDeviceUpdate A gateway has received device updates
gatewayUpstreamMessage A message is sent from a device via a gateway
gatewayDownstreamMessage A message is sent to a device via a gateway
gatewayConfigUpdate A gateway has received a configuration update
gatewayCommError There was an error communicating with a gateway. The gateway might have disconnected abruptly or there’s some kind of network error

Back to the news