Query Samples

  The following is a list of example queries using an example data set. We'll illustrate a number of common query types that may be encountered so you can get an understanding of how the query system works. Each time series in the example set has only a single data point stored and the UIDs have been truncated to a single byte to make it easier to read. The example queries are all Metric queries from the HTTP API and only show the m= component. See /api/query for details. If you are using a CLI tool, the query format will differ slightly so read the documentation for the particular command.

Simple Data


  Time Series

TS# Metric Tags TSUID
1 sys.cpu.system dc=dal host=web01 0102040101
2 sys.cpu.system dc=dal host=web02 0102040102
3 sys.cpu.system dc=dal host=web03 0102040103
4 sys.cpu.system host=web01 010101
5 sys.cpu.system host=web01 owner=jdoe 0101010306
6 sys.cpu.system dc=lax host=web01 0102050101
7 sys.cpu.system dc=lax host=web02 0102050102
8 sys.cpu.user dc=dal host=web01 0202040101
9 sys.cpu.user dc=dal host=web02 0202040102

  UIDs

Name UID
Metrics
cpu .system 01
cpu .user 02
Tagks
host 01
dc 02
owner 03
Tagvs
web01 01
web02 02
web03 03
dal 04
lax 05
doe 06

WARNING

  This isn't necesarily the best way to setup your metrics and tags, rather it's meant to be illustrative of how the query system works. In particular, TS #4 and 5, while legitimate timeseries, may screw up your queries unless you know how they work. In general, try to maintain the same number and type of tags for each timeseries.

Under the Hood


Query 1 - All Time Series for a Metric


Query 2 - Filter on a Tag


Query 3 - Specific on a Tag


Query 4 - TSUID Query


Query 5 - Multi-TSUID Query


Query 6 - Grouping


Query 7 - Group and Filter


Query 8 - Grouping With OR


results matching ""

    No results matching ""