Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to return one value for the result of a dynamic aggregate? #59

Open
Chekov2k opened this issue Mar 13, 2018 · 0 comments
Open

How to return one value for the result of a dynamic aggregate? #59

Chekov2k opened this issue Mar 13, 2018 · 0 comments

Comments

@Chekov2k
Copy link

Hello,
we are using the current stable Gnocchi Grafana Datasource plugin in to query the metrics of an OpenStack cluster. At the moment, I am trying to use the dynamic aggregates query type to fill a Single Stats panel. However, the return value of the query is an array of items instead of a single value. What am I doing wrong?

The expected output of the query is the sum of the mean number of vcpus of all instances for a given search string in the given time period (I know I can do that via the resource search (aggregated measurements) but would like to apply some math to the result).

The operation I have defined is: (aggregate sum (metric vcpus mean))
and the response I can see in the Query Inspector looks like this:

...
response:Object
measures:Object
aggregated:Array[4]
0:Array[2018-03-13T13:25:00+00:00,300,16]
1:Array[2018-03-13T13:50:00+00:00,300,192]
2:Array[2018-03-13T13:55:00+00:00,300,48]
3:Array[2018-03-13T14:00:00+00:00,300,224]
references:Array[32]
0:Object
...

How do I aggregate the response array into a single value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant