Skip to main content

Tags

Tags are the most flexible way to group Agents.

Agent Tags

An Agent may have several associated Tags and most operations on Agents can be filtered by corresponding Tags, based on one or even several Tags, using the tags option.

In addition to global and per-Agent context, there is also a per-Tag context which overrides anything defined within the global context. For example, if we want a group of Agents to sample more aggressively, in the Pipe context, there is a variable interval which has a default value of 15m. By tagging the Agents as urgent, it’s easy to make them sample faster:

$> hotrod context tag urgent interval=2m

Pipe Tags

As Agent updates can filter on Tags, you can carry out bulk operations such as attaching Pipes to groups of Agents. However, there is a more efficient method wherein the Pipe itself may have associated Tags:

name: sample

tags:
- samplers

context:
interval: 15m

input:
...

Pipes with Tags will automatically attach to Agents if there is a matching Tag. Therefore, the sample Pipe will be enabled for all Agents with tags samplers.

Bulk Upload of Agents

It can be tedious to add Agents one by one using hotrod agents add, so there is a bulk upload option:

# agents.sls

Sites:
- name: test1
bbox: 1
tags: [active]

- name: test2
bbox: 2
tags: [active,fast]

Given this file, we can easily populate Agents as follows:

$> hotrod agents add-all agents.sls 

$> hotrod agents list

name | id | tags | pipes | last seen
-------+----+-------------+-------+-----------
test1 | 1 | active | |
test2 | 2 | active fast | |
note

This does not merge with existing Agents and can only be used for the populating of Agents and Tags in the initial stages.