openTSDB表达式概述
/api/query, 内含rate options, filters
m=sum:rate{counter,,1000}:if.octets.in
Name | Data Type | Required | Description | Default | Example |
---|---|---|---|---|---|
counter | Boolean | Optional | Whether or not the underlying data is a monotonically increasing counter that may roll over | false | true |
counterMax | Integer | Optional | A positive integer representing the maximum value for the counter. | Java Long.MaxValue | 65535 |
resetValue | Integer | Optional | An optional value that, when exceeded, will cause the aggregator to return a 0 instead of the calculated rate. Useful when data sources are frequently reset to avoid spurious spikes. | 0 | 65000 |
dropResets | Boolean | Optional | Whether or not to simply drop rolled-over or reset data points. | false | true |
Filters
Whether or not results are grouped depends on which curly bracket the filter is in. Two curly braces are now supported per metric query. The first set is the group by filter and the second is a non group by filter, e.g.
{host=wildcard(web*)}{colo=regexp(sjc.*)}
. This specifies any metrics where the colo matches the regex expression"sjc.*"
and the host tag value starts with"web"
and the results are grouped by host. If you only want to filter without grouping then the first curly set must be empty, e.g.{}{host=wildcard(web*),colo=regexp(sjc.*)}
.