Why Use Graphite Tags?

It’s becoming common in monitoring systems to use a tagged (or labelled) metric format. This allows for more flexibility both in naming and retrieving metrics.

Note that when using tags, each metric is uniquely identified by its name and set of tag/value pairs. As a result, an existing tagged metric cannot be updated to contain new tags.

For example, let’s count 500 responses for My App in both formats:

  

Dotted Format

myapp.*.*.responses.500

  

Tag Format

seriesByTag("path=myapp.responses","code=500")

The latter allows us to quickly slice and dice metrics by their tags that you get to specify when creating the metric. We don’t have to remember what’s in each position in the dotted hierarchy, and the tags make the query “self documenting”.

Tags are particularly useful in modern cloud environments, where e.g. host or instance may change often, while the total number of metrics being stored and queried remains fairly constant.