Open Marek77 opened 7 years ago
Ah ok, so this is working kinda as expected. What's happening is that the query is using the deviation function for both the group-by and the downsampler. The downsampler returns a single value with a single time series. Then when you ask for the deviation of that single time series (in the group-by step), there is only time series to evaluate so it returns 0. If you had more than one time series it would give you the proper value.
Instead, query for something like
{ "aggregator" => "sum",
"downsample" => "0all-dev-zero",
"metric" => "metric.xmit_data",
"rate" => "false",
"tags" => {
"hostname" => "mo0",
},
},
The aggregator
doesn't matter since you only have a single series.
I am trying to get the standard deviation from TSDB but I am failing to do so (atleast to what I imagine) This is my query that I pass -
{
"metric" => "xyz"
"aggregator" => "avg"
"downsample" => "1w-dev"
"tags" => {}
}
I am looking for standard deviation for the data points in the last week lets say and I think I am confused between aggregator and downsample. Can someone help me with the right format?
Thanks.
I have some data in my OpenTSDB instance (v 2.3 stable), and I want to get single values of aggregate functions (max, min, avg, dev) for a given metric and time interval (say last hour). I'm using /api/query endpoint via HTTP POST like so (Perl):
and I'm getting these results ("tags" and "aggregateTags" removed for clarity):
So max=5875298392, min=5761987096, avg=5818614235.93622 and dev=0.... It seems highly unlikely (given data in the screenshot) that standard deviation is 0 ?!
Whatever I do, for any of my metrics, dev is always 0; this seems to be a bug.
OpenTSDB version [2.3.0] built from revision in a MODIFIED state Built on Thu Dec 29 14:57:37 GMT+100 2016 by root@centos.localhost:/root/rpmbuild/BUILD/opentsdb-2.3.0
root@opentsdb:~# rpm -qi opentsdb Name : opentsdb Version : 2.3.0 Release : 1 Architecture: noarch Install Date: Wed Sep 6 07:00:16 2017 Group : Service/Monitoring Size : 13686339 License : LGPLv2.1+ Signature : (none) Source RPM : opentsdb-2.3.0-1.src.rpm Build Date : Thu Dec 29 08:59:01 2016 Build Host : centos.localhost Relocations : (not relocatable) Packager : opentsdb@googlegroups.com URL : http://opentsdb.net Summary : A scalable, distributed Time Series Database