The Wavefront Query Language has been designed especially for time series data. Time series data is unique and requires a query language that accommodates the periodicity, potential irregularity, and streaming nature of the data.
The simplest and most commonly used type of query retrieves an individual metric:
ts(<metricName>). If you are new to Wavefront, you might, for example, want to measure the time spent in the CPU idle task—
cpu.idle—across all sources.
For this example you enter
ts(cpu.idle) into a query field to produce the chart below:
Filtering by Source
The example chart displays many lines, particularly below 8M. To simplify the chart, you can filter by source using the optional
ts(<metricName>, source=<sourceName>). For example, use a
source="m*" filter to show all sources that start with “m”. The number of lines is reduced and the Y-axis scale changes from 30M to 5M:
Applying Aggregation Functions
For further exploration try one of the aggregation functions. Aggregation functions are the second most common query. For example, use
avg() to show the average value of the
cpu.idle metric across all sources. Or use
sum() to get a total for all sources starting with “m”. Here’s the chart adding
Applying Mathematical Functions
Notice how the sum of
cpu.idle is slowly increasing over time. To increase your proficiency in the language and to learn the power of the other functions, take a metric example and experiment with the different functions. For example, the
sum(ts(cpu.idle)) metric is a counter metric, or a metric that continuously increases over time. Counter metrics give a snapshot of a current count, but they do not provide information such as the rate of change. The query language has a
deriv() function that transforms a counter to show the rate of change per second:
Wavefront documentation includes tutorials, reference, and guides on the query language. And the query builder and query wizard can help you come up to speed quickly while using the product.
Once you have experimented with simple use cases, review Wavefront Query Language Quick Reference. The language reference gives an overview of the different types of functions that can be used in a query.
For in-depth discussions and examples, see some of the advanced function guides.