Skip to main content
Version: 3.3.1

Tags

Tags are the most flexible way to partition agents into groups.

Agent Tags

An agent may have several associated tags. Most operations on agents can be filtered on matching tags. For instance when updating agents, can filter agents based on one or several tags with the --tags option.

As well as global and per-agent contexts there is also per-tag context. This overrides anything defined in the global context.

For example, we want a group of agents to sample more aggressively. In the pipe's context, there is a variable interval which has a default value of 15m. Assume the agents share the tag 'urgent', then it is easy to make them sample faster:

$ hotrod context tag urgent interval=2m

Pipe Tags

Since hotrod agents update can filter on tags, it is possible to do bulk operations like attaching pipes to groups of agents however there is a cleaner method. 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, so all agents with the tag 'samplers' will have the sample pipe enabled.

Bulk Upload of Agents

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

# agents.sls
Sites:
- name: test1
bbox: 1
tags: [active]
- name: test2
bbox: 2
tags: [active,fast]

Given this file, we can populate some agents easily:

$ 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 so can only be used for initial populating of agents and tags.