Average graph capability

Hello, i just join the Grafana community to ask some help for a specific need on Grafana graph.
I use grafana connected to an open-TSDB base for Capacity Planning purpose
I have several (32) servers with their CPU usage graph. What i want to see is the average CPU usage of all these servers agregated in only one graph. I don’t find the manner to build this graph. First of all, is this possible and how can i build it ?
Thank you in advance for your response.

I shared the dashboard, its name is WEBSEAL

It depends on which version of OpenTSDB you are using. But even on older versions there is at least limited support for wildcards in filters that should allow you to select multiple servers in one query:

http://opentsdb.net/docs/build/html/user_guide/query/filters.html

Thank you Daniellee for your response, and desole for my late response. The TSDB version is 2.1.1. I 'm not sure if my question is well asked. What i want is to have only one graph gving the average CPU usage of all the 32 servers. I don’t know if this kind of query is possible in Grafana on this TSDB version ?

What i understand is that i have to filter on the name of the hosts to have the 32 servers and to select the m parameter to avg to merge the time series and obtain the average usage of the 32 servers ? Do you confirm ?
Best regards and excuse my poor level of english !

Yes, it should be possible. I don’t know much about OpenTSDB but something like this I think with the host = *:

image

So i did this query with the asterix on the last digit of the name, and the query fails


with error message : {
“error”: {
“code”: 400,
“message”: “No such name for ‘tagv’: ‘SWMUZR0CDD5*’”,
“details”: “No such name for ‘tagv’: ‘SWMUZR0CDD5*’”,
“trace”: "net.opentsdb.tsd.BadRequestException: No such name for ‘tagv’: ‘SWMUZR0CDD5*’\n\tat net.opentsdb.tsd.QueryRpc.handleQuery(QueryRpc.java:123)

Any idea ?

I tried directly on the API ans it gives the 3 graphs of the servers, the query doesn’t merge the graphs even with the m aggregator parameter selected to avg.

For your version of OpenTSDB, the filtering is very limited. It seems to only allow * on its own or pipe | with exact matches.

From the docs for version 2.1:

* - The asterisk (or wildcard) will return a separate result for each unique tag value detected. E.g. if the tag key host was paired with web01 and web02 then there would be two groups emitted, one on web01 and one on web02.
| - The pipe (or literal_or) will return a separate result only for the exact tag values specified. I.e. it will match only time series with the given tag value and group on each of those matches.

and this: Opentsdb: Support for Opentsdb 2.2 filters · Issue #3077 · grafana/grafana · GitHub

Maybe a template variable would help with the filtering: OpenTSDB data source | Grafana documentation

You could create a dropdown (template variable) and use regex there to filter out the servers you want. Though you should probably use tag_values(your_metric_name, host) instead (suggest_tagv was just a quick way to show an example).

image

then use the template variable in your query:

image

Thank you Daniel for your response.
I’m able to use templating variables as you can see below.
But what i want is only one graph merging all servers graphs in an average aggregation. The aggregator avg is selected but it doesn’t merge the graphs of the seervers. Any idea on how to do this ?
What i understand in the documentation about the aggregator is a mean to align values on the time by calculating (sum,avg) the values missing, am i wrong ?

Best regards.

That was my interpretation as well. I was hoping someone who knows more about OpenTSDB than me would help here. Maybe this is something that only works on later versions of OpenTSDB? Version 2.3 has a groupBy filter:

http://opentsdb.net/docs/build/html/api_http/query/exp.html

Whether or not to group results by the tag values matching this filter. E.g. grouping by host will return one result per host. Not grouping by host would aggregate (using the aggregation function) all results for the metric into one series

Thank you Daniel for your response, I appreciate the time you spend to respond to my questions.

My question stays openned, if a OpenTSDB specialist has the answer to why the aggregation on V2.1 doesn’t work correctly, don’t hesitate.

Bests regards.

And you cannot upgrade to OpenTSDB 2.3 or ask the maintainer to upgrade?

No, I don’t have the hand on the TSDB version. I would ask my customer.
Regards