Guide to Tagging

Overview

Tagging is used throughout the Stackstate product to make it easier to subset and query the machines and metrics that you have to monitor. Without the ability to assign and filter based on tags, finding the problems that exist in your environment and narrowing them down enough to discover the true causes would be extremely difficult.

How to assign tags

There are four primary ways to assign tags: inherited from the integration, in the configuration, in the UI, and using the API. The recommended method is to rely on the integration or via the configuration files.

Inheriting tags from an integration

The easiest method for assigning tags is to rely on the integration. Tags assigned to your Chef recipes, Docker labels, and more are all automatically assigned to the hosts and metrics when they are brought in to Stackstate.

The following integration sources create tags automatically in Stackstate:

ApacheApache Host and Port
BTRFSUsage & Replication Type
ConsulPrevious and Current Consul Leaders and Followers, Consul Datacenter, Service Name, Service ID
CouchDBDatabase Name, Instance Name
CouchBaseCouchBase Tags, Instance Name
DockerDocker Container and Image Name, Container Command, Container Labels
ElasticsearchCluster Name, Host Name, Port Number
EtcdState Leader or Follower
FluentdHost Name, Port Number
Go ExpvarExpvar Path
GunicornState Idle or Working, App Name
HAProxyService Name, Availability, Backend Host, Status, Type
HTTP CheckURL, Instance
JMXJMX Tags
KafkaTopic
KubernetesMinion Name, Namespace, Replication Controller, Labels, Container Alias
MarathonURL
MemcachedHost, Port, Request, Cache Hit or Miss
MesosRole, URL, PID, Slave or Master Role, Node, Cluster,
MongoServer Name
OpenStackNetwork ID, Network Name, Hypervisor Name, ID, and Type, Tenant ID, Availability Zone
PHP FPMPool Name
Postfix Queue, Instance
RabbitMQNode, Queue Name, Vhost, Policy, Host
RedisHost, Port, Slave or Master
RiakCSAggregation Key
SNMPDevice IP Address
SupervisordServer Name, Process Name
TeamCityTags, Code Deployments, Build Number
TokuMXRole Primary or Secondary, Replset, Replstate, Db, Coll, Shard
VarnishName, Backend
VSphereHost, Datacenter, Server, Instance
Win32 EventsEvent ID
Windows ServicesService Name

Assigning tags using the configuration files

The Stackstate integrations are all configured via the yaml configuration files located in the conf.d directory in your agent install. For more about where to look for your configuration files, refer to this article. You can define tags in the configuration file for the overall agent as well as for each integration, though the stackstate.conf file is a more traditional ini file. In yaml files, there is a tag dictionary with a list of tags you want assigned at that level. Any tag you assign to the agent will apply to every integration on that agent’s host.

Dictionaries with lists of values have two different yet functionally equivalent forms:

tags: firsttag, secondtag, thirdtag

or

tags:
  - firsttag
  - secondtag
  - thirdtag

You will see both forms in the yaml configuration files, but for the stackstate.conf ini file only the first form is valid.

Each tag can be anything you like but you will have the best success with tagging if your tags are key:value pairs. Keys could represent the role, or function, or region, or application and the value is the instance of that role, function, region, or application. Here are some examples of good tags:

region:east
region:nw
application:database
database:primary
role:sobotka

The reason why you should use key value pairs instead of simply values will become apparent when you start using the tags to filter and group metrics and machines. That said, you are not required to use key value pairs and simple values are valid.