Ceph, Openstack, Rados GW, Telemetry

Ceph RGW usage with Openstack Telemetry

We assume that the  Ceph RGW (i.e Rados Gate Way) and Openstack Keystone are already integrated and working. If not you can use the Ceph documentation here.
You can make sure everything works properly with

# source openrc // with admin tenant
# swift -V 2.0 -A http://localhost:5000/v2.0  stat
             Account: v1
           Containers: 1
              Objects: 174
                 Bytes: 26824860
X-Account-Bytes-Used-Actual: 27140096
             X-Trans-Id: tx00000000000000000000d-0056b23cdc-19cf4-default
           Content-Type: text/plain; charset=utf-8
          Accept-Ranges: bytes

Make sure usage logs are enabled on the radosgw by setting rgw_enable_usage_log = true. You will also need a RadosGW admin user. I created the same  as follows:

# radosgw-admin user create --uid admin --display-name "admin user" --caps "usage=read,write;metadata=read,write;users=read,write;buckets=read,write"

In /etc/ceilometer/ceilometer.conf, uncomment and configure the following

radosgw = object-store
[rgw_admin_credentials]
access_key = <admin user access_key>
secret_key = <admin user secret>

The rgw ceilometer module depends on requests-aws to access the Admin ops API. Install it and restart the ceilometer service

# pip install requests-aws
# openstack-service restart ceilometer

After a while, the meters should show up

(keystone_admin)# ceilometer meter-list
+---------------------------------+-------+---------+---------------------------------------------+---------+----------------------------------+
| Name                            | Type  | Unit    | Resource ID                                 | User ID | Project ID                       |
+---------------------------------+-------+---------+---------------------------------------------+---------+----------------------------------+
| image                           | gauge | image   | d230f54e-6877-451e-bd6c-ca1c460b9041        | None    | ff4d8e6c7e244acb82476fb6acba1833 |
| image.size                      | gauge | B       | d230f54e-6877-451e-bd6c-ca1c460b9041        | None    | ff4d8e6c7e244acb82476fb6acba1833 |
| radosgw.api.request             | gauge | request | 4ddbab4fb6b445fb8195dd08b9cc05a9            | None    | 4ddbab4fb6b445fb8195dd08b9cc05a9 |
| radosgw.api.request             | gauge | request | 8ce73b1b38ab4945b294d691dfd86101            | None    | 8ce73b1b38ab4945b294d691dfd86101 |
| radosgw.api.request             | gauge | request | ff4d8e6c7e244acb82476fb6acba1833            | None    | ff4d8e6c7e244acb82476fb6acba1833 |
| radosgw.containers.objects      | gauge | object  | 4ddbab4fb6b445fb8195dd08b9cc05a9/container1 | None    | 4ddbab4fb6b445fb8195dd08b9cc05a9 |
| radosgw.containers.objects.size | gauge | B       | 4ddbab4fb6b445fb8195dd08b9cc05a9/container1 | None    | 4ddbab4fb6b445fb8195dd08b9cc05a9 |
| radosgw.objects                 | gauge | object  | 4ddbab4fb6b445fb8195dd08b9cc05a9            | None    | 4ddbab4fb6b445fb8195dd08b9cc05a9 |
| radosgw.objects                 | gauge | object  | 8ce73b1b38ab4945b294d691dfd86101            | None    | 8ce73b1b38ab4945b294d691dfd86101 |
| radosgw.objects                 | gauge | object  | ff4d8e6c7e244acb82476fb6acba1833            | None    | ff4d8e6c7e244acb82476fb6acba1833 |
| radosgw.objects.containers      | gauge | object  | 4ddbab4fb6b445fb8195dd08b9cc05a9            | None    | 4ddbab4fb6b445fb8195dd08b9cc05a9 |
| radosgw.objects.containers      | gauge | object  | 8ce73b1b38ab4945b294d691dfd86101            | None    | 8ce73b1b38ab4945b294d691dfd86101 |
| radosgw.objects.containers      | gauge | object  | ff4d8e6c7e244acb82476fb6acba1833            | None    | ff4d8e6c7e244acb82476fb6acba1833 |
| radosgw.objects.size            | gauge | B       | 4ddbab4fb6b445fb8195dd08b9cc05a9            | None    | 4ddbab4fb6b445fb8195dd08b9cc05a9 |
| radosgw.objects.size            | gauge | B       | 8ce73b1b38ab4945b294d691dfd86101            | None    | 8ce73b1b38ab4945b294d691dfd86101 |
| radosgw.objects.size            | gauge | B       | ff4d8e6c7e244acb82476fb6acba1833            | None    | ff4d8e6c7e244acb82476fb6acba1833 |
+---------------------------------+-------+---------+---------------------------------------------+---------+----------------------------------+

Get the samples for the radosgw.objects meters on tenant ID 4ddbab4fb6b445fb8195dd08b9cc05a9 (admin)

(keystone_admin)# ceilometer sample-list -q resource_id=4ddbab4fb6b445fb8195dd08b9cc05a9 -m radosgw.objects
+----------------------------------+-----------------+-------+--------+--------+----------------------------+
| Resource ID                      | Name            | Type  | Volume | Unit   | Timestamp                  |
+----------------------------------+-----------------+-------+--------+--------+----------------------------+
| 4ddbab4fb6b445fb8195dd08b9cc05a9 | radosgw.objects | gauge | 87.0   | object | 2016-02-03T17:21:50.201000 |
| 4ddbab4fb6b445fb8195dd08b9cc05a9 | radosgw.objects | gauge | 0.0    | object | 2016-02-03T16:39:15.050000 |
+----------------------------------+-----------------+-------+--------+--------+----------------------------+
Advertisements