Filtered Query - Grouped and Ungrouped

35 views
Skip to first unread message

nwhitehead

unread,
Apr 18, 2016, 8:32:59 AM4/18/16
to OpenTSDB
Trying to figure out this paragraph in the /api/query documentation:

For URI queries, the type precedes the filter expression in parentheses. The format is <tagk>=<type>(<filter_expression>). 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=web01}{colo=regexp(sjc.*)}. If you only want to filter without grouping then the first curly set must be empty, e.g. {}{host=web*}

I cannot reconcile the two examples, which I assume are intended to be equivalent, except one is un-grouped and the second is not. The first specifies a colo tagk but the second does not, and the second has no filter expression. If I understand the URI filtered query specification, I think the examples should be:

  • {host=web*}{colo=regexp(sjc.*)}  :   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
  • {}{host=web*,colo=regexp(sjc.*)}  :   Specifies nany metrics where colo matches the regex expression "sjc.*" and the host tag value starts with "web" and the results are not grouped.
But I'm not sure. I think something's not right with the example. Can anyone clarify ?

//Nicholas

ManOLamancha

unread,
May 3, 2016, 5:17:33 PM5/3/16
to OpenTSDB
You're correct, thanks for finding it! Posted a fix.
Reply all
Reply to author
Forward
0 new messages