Metric list is not listing all metrics

Bug #1607392 reported by Nicolas Vila
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-gnocchiclient
Confirmed
Undecided
gordon chung

Bug Description

Using gnocchi 2.1.1.dev131, we are creating a new metric called cpu.delta.cost. When we do a gnocchi metric show <ID> the metric is shown, but a metric list shows all metrics but not the cpu.delta.cost. The metric looks like this:

root@18b26f04ced9:~# gnocchi metric show 71494A60509B431BBA137ED213E0CDD3
+------------------------------------+---------------------------------------------------------------------------+
| Field | Value |
+------------------------------------+---------------------------------------------------------------------------+
| archive_policy/aggregation_methods | sum |
| archive_policy/back_window | 0 |
| archive_policy/definition | - points: 2160, granularity: 1:00:00, timespan: 90 days, 0:00:00 |
| | - points: 360, granularity: 1 day, 0:00:00, timespan: 360 days, 0:00:00 |
| | - points: 60, granularity: 30 days, 0:00:00, timespan: 1800 days, 0:00:00 |
| archive_policy/name | rating |
| created_by_project_id | None |
| created_by_user_id | cf2c2f2e68674ffbb63241431a04d66d |
| id | 71494a60-509b-431b-ba13-7ed213e0cdd3 |
| name | cpu.delta.cost |
| resource/created_by_project_id | None |
| resource/created_by_user_id | cf2c2f2e68674ffbb63241431a04d66d |
| resource/ended_at | None |
| resource/id | 03e4bfef-2603-4014-b6a8-55306bdab745 |
| resource/original_resource_id | 03e4bfef-2603-4014-b6a8-55306bdab745 |
| resource/project_id | 8f101a1a2b88420590be6b7f677d0de8 |
| resource/revision_end | None |
| resource/revision_start | 2016-07-14T14:48:10.832184+00:00 |
| resource/started_at | 2016-07-14T14:48:10.832163+00:00 |
| resource/type | instance |
| resource/user_id | 99a428c0e21341d6828bcc4feb64b398 |
| unit | None |
+------------------------------------+---------------------------------------------------------------------------+

This happens using gnocchiclient as well as GETting directly to the gnocchi API.

Thanks, regards.

Revision history for this message
Julien Danjou (jdanjou) wrote :

This is likely an authentication problem. You need to provide more details about what user/project you pass in the headers. Run with --debug also.

Changed in gnocchi:
status: New → Incomplete
Revision history for this message
gordon chung (chungg) wrote :

if it's not because of authentication it's probably because i didn't add pagination support to client. WIP right now

Revision history for this message
Nicolas Vila (nvlan) wrote :

Hello Julien,

In the following paste: http://paste.openstack.org/show/547831/ I've run a metric list showing 20 cpu.delta.cost metrics, while running a query on the database shows that there are 61 of those metrics. I ran also a metric list (empty) and a metric show with --debug.

These metrics are created_by_user_id ceilometer, and the environment file I'm using with gnocchi client belong to cloudadmin (a user that *should* be able to list all metrics, since the policy.json file has not be altered).

Please let me know if you need any further information.

Kind regards.

Revision history for this message
gordon chung (chungg) wrote :

hi Nicolas, is this only a client issue? what happens using REST Api? specifically if you take into account the results are paginated?

Revision history for this message
Nicolas Vila (nvlan) wrote :

Hello Gordon,

The same happens while curl'ing the API:

root@18b26f04ced9:~# curl -g -i -X GET http://localhost:8041/v1/metric/b400fa29-9ff4-4c75-bfe8-2d456751a507 -H "User-Agent: keystoneauth1" -H "Content-Type: application/json" -H "X-Auth-Token: $token"
HTTP/1.1 200 OK
Date: Thu, 04 Aug 2016 20:20:16 GMT
Server: Apache/2.4.7 (Ubuntu)
Content-Length: 1257
Content-Type: application/json; charset=UTF-8

{"created_by_user_id": "ed4ab075ddd7466fb01228baa12c438b", "resource": {"created_by_user_id": "ed4ab075ddd7466fb01228baa12c438b", "started_at": "2016-07-14T20:49:25.234150+00:00", "user_id": "d6932fe98cad4fcc8c72d8fd25d83bce", "revision_end": null, "revision_start": "2016-07-14T20:49:25.234178+00:00", "created_by_project_id": null, "original_resource_id": "f9031504-2422-4ba2-a899-0712dfce4dcd", "ended_at": null, "project_id": "8f101a1a2b88420590be6b7f677d0de8", "type": "instance", "id": "f9031504-2422-4ba2-a899-0712dfce4dcd"}, "name": "cpu.delta.cost", "created_by_project_id": null, "archive_policy": {"definition": [{"points": 8640, "timespan": "360 days, 0:00:00", "granularity": "1:00:00"}, {"points": 1080, "timespan": "1080 days, 0:00:00", "granularity": "1 day, 0:00:00"}, {"points": 257, "timespan": "1799 days, 0:00:00", "granularity": "7 days, 0:00:00"}, {"points": 120, "timespan": "3600 days, 0:00:00", "granularity": "30 days, 0:00:00"}, {"points": 60, "timespan": "5400 days, 0:00:00", "granularity": "90 days, 0:00:00"}, {"points": 20, "timespan": "7200 days, 0:00:00", "granularity": "360 days, 0:0root@18b26f04ced9:~#
root@18b26f04ced9:~#
root@18b26f04ced9:~# curl -g -i -X GET http://localhost:8041/v1/metric -H "User-Agent: keystoneauth1" -H "Content-Type: application/json" -H "X-Auth-Token: $token" | grep b400fa29-9ff4-4c75-bfe8-2d456751a507
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 956k 100 956k 0 0 1132k 0 --:--:-- --:--:-- --:--:-- 1131k
root@18b26f04ced9:~#

Regards.

Revision history for this message
gordon chung (chungg) wrote :

and if you take the last entry as the marker for next page?

Revision history for this message
Nicolas Vila (nvlan) wrote :

Adding the marker, now I see metric with id b400fa29-9ff4-4c75-bfe8-2d456751a507. What is more, executing "gnocchi metric list" outputs only 1000 results, that's why I didn't see it at first.

Regards.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to gnocchi (master)

Fix proposed to branch: master
Review: https://review.openstack.org/351733

Changed in gnocchi:
assignee: nobody → gordon chung (chungg)
status: Incomplete → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to gnocchi (master)

Reviewed: https://review.openstack.org/351733
Committed: https://git.openstack.org/cgit/openstack/gnocchi/commit/?id=cf34b97bf287e1090575ec7eb42e97c7996045cb
Submitter: Jenkins
Branch: master

commit cf34b97bf287e1090575ec7eb42e97c7996045cb
Author: gord chung <email address hidden>
Date: Fri Aug 5 08:59:17 2016 -0400

    highlight pagination more prominently

    it's easy to skip over the fact that results are paginate. we
    should highlight this point so users don't overlook it.

    Change-Id: I8e49ede4bb17a79ead78c33a31a1dd27c90e61b9
    Partial-Bug: #1607392

Julien Danjou (jdanjou)
affects: gnocchi → python-gnocchiclient
Changed in python-gnocchiclient:
status: In Progress → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.