The Wavefront Query Language has been designed for time series data. Time series data are unique and requires a query language that accommodates the periodicity, potential irregularity, and streaming nature of the data.
Watch these videos to get you started:
A simple query retrieves an individual metric:
For example, you can show when the CPU is idle by entering
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. 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 result of
sum(ts(cpu.idle)) is slowly increasing over time, but does not show how fast the sum is increasing. The query language has a
deriv() function that shows the rate of change per second:
What’s next depends on the type of data you’re interested in, and how you want to interact with your data.
Query Types for Different Data
Most Wavefront users query for metrics, but we support interacting with other data.
Charts for metrics also support the following types of queries:
A separate set of interfaces is available for developers who are interested in traces and spans.
Docs & Wizards
Wavefront documentation includes tutorials, reference, and guides on the query language.
- Query builder and query wizard can help you come up to speed quickly while using the product.
- Log in to Wavefront and learn with our Tutorial and Tour. The Tutorial includes an Interactive Query Language Explorer that shows examples for each function.
- Wavefront Query Language Quick Reference. gives an overview of the different types of functions that can be used in a query. Each function names is a link to a reference page for the function.
- For in-depth discussions and examples, see some of the advanced function guides.
This doc set includes videos and explanations from the engineering team that helps you come up to speed quickly:
|How can I combine multiple series?||Aggregating Time Series||Time Series and Interpolation|
|Why does my query return NO DATA?||Maybe the time series don’t match. See When Multiple Series Match (Or Not)|
|I got a warning about pre-aligned data. Why?||Wavefront improves performance by wrapping
|How can I use Wavefront for anomaly detection?||You can use AI Genie or detect anomalies with functions and statistical functions.|
|How can I improve query performance?||Consider bucketing with align(). Investigate slow queries.|