Skip to main content

Creating your first tagger

This section explains the process of creating a tagger via our web UI. A tagger that detects when battery output power exceeds a certain threshold will be used as an example. If working through this example with our web UI open, you need to substitute your own data sources and metadata fields.

1. Accessing the event autotagging dashboard

You can do the following from the Event Autotagging Dashboard:

  • Create, edit, and manage taggers
  • Enable or disable taggers to run whenever a new robolog is ingested
  • Run your own test and backfill invocations
  • View the status of invocations from a tagger's details page
  • Access the results of invocations

2. Creating a new tagger

Creating a new tagger involves choosing a name and optional description for the tagger.

  • Click "+ Create tagger."
  • Enter a name and description.
  • Click "Continue."

3. Editing your draft

While creating or editing a tagger definition, you will be guided through each step of the process one section at a time. If editing an existing definition, you can skip to the section you want to modify by clicking on the section's name in the section navigation toolbar.

The creation and editing UI allows you to customize a tagger, save a version draft, validate the tagger's definition to catch common configuration errors, and publish the tagger version.

The UI's split screen composer allows you to either customize your definition using graphical components or modify the YAML directly in the provided text editor. Both remain synchronized as you work.

Tip: Use the text editor to copy a section's YAML definition from an existing tagger as a starting point for a similar tagger.

Variables

  1. Enter a descriptive variable name (ex. battery_voltage)
  2. Select the source channel from the dropdown (ex. /base/battery)
  3. Select the data access path for the variable (ex. voltage)
  4. Repeat to add more variables as needed (ex. battery_current)

The following YAML shows the variables section resulting from carrying out the steps above in the UI:

variables:
battery_voltage:
source: /base/battery
path:
- voltage
battery_current:
source: /base/battery
path:
- current

Predicates

  1. Enter a descriptive predicate name (ex. battery_power_surge).
  2. Define the predicate logic that identifies events of interest given the input variables and optional intermediate calculations.
  3. Repeat to add more predicates as needed.

Reminder: A predicate's evaluation must return a boolean value. During runtime, the time interval at which all the predicates evaluate to true are considered part of an event. The event interval spans a contiguous sequence of these occurrences.

In the following example, the predicate battery_power_peak calculates the instantaneous power output using the battery voltage and current message data, and then evaluates whether the power output exceeds a certain threshold.

predicates:
battery_power_peak:
import: |-
def calculate_power(voltage, current):
return voltage * current
calculate: instantaneous_power = calculate_power(battery_voltage, battery_current)
evaluate: 'instantaneous_power > 42'

Outputs

  1. Enter a descriptive output name (ex. surge_event).
  2. Select the metadata field for which new values will be created—one for each event.
  3. Enter a static value, or specify a dynamic output whose value is a function of the event data.
  4. Repeat for additional outputs as needed.

In the following example, the field_id refers to a boolean metadata field. This tagger creates a metadata with a value of true for each surge event detected. This can also be extended to reference a floating-point metadata field for a dynamic output that calculates the peak current during the surge event.

outputs:
surge_event:
field_id: 235974ef-82fe-448e-b756-85318c9ea005
type: static
value: true

4. Publishing the draft

  1. Review the sections summary before publishing your draft.
  2. Click "Publish" to make the tagger version available for testing.

After publishing, the next step is to successfully test the tagger version so that it may be enabled for event autotagging at ingest or for backfill invocations. Proceed to the next section to learn more about tagger test invocations.