Skip to content

Debuging sensors

To understand what a sensor is doing and gather more information from it, you can enable debug mode by setting the verbosity level to 0.

orcas-pulse sensor --v 0

Preflight checks

When you run the sensor, it performs a series of checks to ensure that it can connect to the Pulse Forwarding Proxy and the Pulse API. If any of these checks fail, the sensor will not start.

# TODO use sensor or proxy based on deployment or sensor controller or forwarding proxy
orcas-pulse <sensor/proxy> --pre-flight-check 1 --v 0

Detailed logs

Enabling debug mode provides you with more detailed information in the sensor's logs, including the signals it generates. Here's an example of the log entries:

09:22:39 DBG writing 2 messages to stream
09:22:39 DBG orcas fitness signal group= name= < SIGNAL-NAME-1 > sensor= < SENSOR-NAME > sensor_id= < SENSOR-ID > signal={ < SIGNAL-DATA-1 >} source= < SOURCE >
09:22:39 DBG orcas fitness signal group= name= < SIGNAL-NAME-2 > sensor= < SENSOR-NAME > sensor_id= < SENSOR-ID > signal={ < SIGNAL-DATA-2 >} source= < SOURCE >

Capture Signals

Another way to observe the signals generated by the sensor is by enabling the CaptureSignals flag in the sensor's configuration. This saves the signals as YAML files in the default directory for temporary files, creating a new folder for each sensor.

Sensor Configuration

Within the sensor's specification, set "captureSignals" to true:

kind: FitnessSensor
apiVersion: fitness.orcasio.com/v1alpha3
metadata:
  name:  < SENSOR-NAME >
  namespace: <tenant_ID>
spec:
  captureSignals: true # default is false
  { ... rest of configuration }

Result

In the sensor's log, you will see a message similar to the following:

09:22:39 DBG writing 1 messages to stream
09:22:39 DBG orcas fitness signal group= name= < SIGNAL-NAME > sensor= < SENSOR-NAME > sensor_id= < SENSOR-ID > signal={ < SIGNAL-DATA >} source= < SOURCE >
09:22:40 DBG signal saved to file file name= < SIGNAL-NAME >.yml file path=/tmp/signals/< SENSOR-NAME >

If you examine the generated file, you will find the following YAML structure:

apiVersion: fitness.orcasio.com/v1alpha3
kind: FitnessSignal
metadata:
  creationTimestamp: <SIGNAL-CREATION-TIME>
  name: <SIGNAL-NAME>
  namespace: <tenant_ID>
spec:
  data:
    <SIGNAL-DATA>
  group: <GROUP>
  sensor: <SENSOR-NAME>
  sensorId: <SENSOR-ID>
  source: <SOURCE>
  tags:
    <SIGNAL-TAGS>
  time: <SIGNAL-TIME>
status:
  <SIGNAL-STATUS>