gnocchixyz / gnocchi

Timeseries database
Apache License 2.0
299 stars 85 forks source link

fill option for gnocchi aggregates doesn't work in CLI #1265

Closed dbalagansky closed 2 years ago

dbalagansky commented 2 years ago

When using gnocchi CLI client aggregates sub-command with fill argument, it doesn't get passed to Gnocchi API as URL parameter. By using curl manually, and adding fill by hand it works as expected.

Which version of Gnocchi are you using

$ gnocchi --version
gnocchi 7.0.7

How to reproduce your problem

gnocchi --debug aggregates --fill 1 '(/ (metric cpu rate:mean) (metric vcpus mean)))' id=c1081247-90cb-471b-b1e3-3a927de2e042
...
REQ: curl -g -i -X POST https://URL:8041/v1/aggregates?details=False -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: gnocchi keystoneauth1/4.5.0 python-requests/2.27.1 CPython/3.9.9" -H "X-Auth-Token: TOKEN" -d '{"operations":"(\/ (metric cpu rate:mean) (metric vcpus mean)))","search":"id=c1081247-90cb-471b-b1e3-3a927de2e042","resource_type":"generic"}'
Starting new HTTPS connection (1): URL:8041
https://URL:8041 "POST /v1/aggregates?details=False HTTP/1.1" 200 1090
RESP: [200] connection: close content-length: 1090 content-type: application/json
RESP BODY: {"measures": {"aggregated": [["2022-07-26T16:00:00+00:00", 300.0, 59931000000.0], ["2022-07-26T17:00:00+00:00", 300.0, 59932000000.0], ["2022-07-26T18:00:00+00:00", 300.0, 48748500000.0], ["2022-07-26T19:00:00+00:00", 300.0, 59917500000.0], ["2022-07-26T20:00:00+00:00", 300.0, 59923500000.0], ["2022-07-26T21:00:00+00:00", 300.0, 45232500000.0], ["2022-07-26T22:00:00+00:00", 300.0, 45233000000.0], ["2022-07-26T23:00:00+00:00", 300.0, 45211500000.0], ["2022-07-27T00:00:00+00:00", 300.0, 30511500000.0], ["2022-07-27T01:00:00+00:00", 300.0, 30312500000.0], ["2022-07-27T02:00:00+00:00", 300.0, 30340000000.0], ["2022-07-27T03:00:00+00:00", 300.0, 15275500000.0], ["2022-07-27T04:00:00+00:00", 300.0, 15409500000.0], ["2022-07-27T05:00:00+00:00", 300.0, 15695000000.0], ["2022-07-27T06:00:00+00:00", 300.0, 59898000000.0], ["2022-07-27T07:00:00+00:00", 300.0, 59924000000.0], ["2022-07-27T08:00:00+00:00", 300.0, 59948500000.0], ["2022-07-27T09:00:00+00:00", 300.0, 683125000.0], ["2022-07-27T10:00:00+00:00", 300.0, 727916666.6666666], ["2022-07-27T11:00:00+00:00", 300.0, 795000000.0]]}}

What is the result that you get

fill value doesn't get passed in URL params as per doc: https://gnocchi.osci.io/rest.html#backfill

What is result that you expected

fill gets passed.

tobias-urdin commented 2 years ago

This seems like a valid bug, please open this issue on https://github.com/gnocchixyz/python-gnocchiclient

tobias-urdin commented 2 years ago

See https://github.com/gnocchixyz/python-gnocchiclient/pull/126