DeepSea
DeepSea copied to clipboard
Duplicate entries for prometheus rbd exporter
Description of Issue/Question
/var/log/messages on my admin node was full of this kind of messages :
2019-02-19T00:14:54.817283+01:00 yval1950 node_exporter[2289515]: * collected metric ceph_rbd_image_bytes_provisioned label:<name:"cluster" value:"ceph" > label:<name:"image" value:"7d7b066f-01aa-4ea6-a399-50c7347e51f5" > label:<name:"pool" value:"glance" > gauge:<value:2.147483648e+10 > was collected before with the same name and label values
2019-02-19T00:14:54.817481+01:00 yval1950 node_exporter[2289515]: * collected metric ceph_rbd_image_bytes_provisioned label:<name:"cluster" value:"ceph" > label:<name:"image" value:"7d9ccffe-46a6-40eb-818a-7b00d1bd4c3a" > label:<name:"pool" value:"glance" > gauge:<value:8.589934592e+09 > was collected before with the same name and label values
2019-02-19T00:14:54.817681+01:00 yval1950 node_exporter[2289515]: * collected metric ceph_rbd_image_bytes_provisioned label:<name:"cluster" value:"ceph" > label:<name:"image" value:"802baca5-80ea-4269-ba60-22f3da060a98" > label:<name:"pool" value:"glance" > gauge:<value:2.361393152e+09 > was collected before with the same name and label values
2019-02-19T00:14:54.817878+01:00 yval1950 node_exporter[2289515]: * collected metric ceph_rbd_image_bytes_provisioned label:<name:"cluster" value:"ceph" > label:<name:"image" value:"80a5874f-4af9-4acc-89c2-566dedb1437f" > label:<name:"pool" value:"glance" > gauge:<value:4.831838208e+10 > was collected before with the same name and label values
It seems that rbd exporter cron script /var/lib/prometheus/node-exporter/rbd.sh is generating one similar entry for each volume and its snapshots. For example this volume :
rbd du cinder/volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a
NAME PROVISIONED USED
volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a@snapshot-c91c77b4-fc85-4857-9a9c-79c0b1ed91ac 200GiB 94.1GiB
volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a@snapshot-cbcf0289-9644-4b64-a750-bf0e78d31497 200GiB 0B
volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a@snapshot-c8b1822d-9f4c-4deb-b872-0e59124f8954 200GiB 10.5GiB
volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a 200GiB 11.5GiB
<TOTAL> 200GiB 116GiB
will produce:
ceph_rbd_image_bytes_used{image="volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a",snapshot="snapshot-c91c77b4-fc85-4857-9a9c-79c0b1ed91ac",cluster="ceph",pool="cinder"} 101040783360
ceph_rbd_image_bytes_provisioned{image="volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a",snapshot="snapshot-c91c77b4-fc85-4857-9a9c-79c0b1ed91ac",cluster="ceph",pool="cinder"} 214748364800
ceph_rbd_image_bytes_used{image="volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a",snapshot="snapshot-cbcf0289-9644-4b64-a750-bf0e78d31497",cluster="ceph",pool="cinder"} 0
ceph_rbd_image_bytes_provisioned{image="volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a",snapshot="snapshot-cbcf0289-9644-4b64-a750-bf0e78d31497",cluster="ceph",pool="cinder"} 214748364800
ceph_rbd_image_bytes_used{image="volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a",snapshot="snapshot-c8b1822d-9f4c-4deb-b872-0e59124f8954",cluster="ceph",pool="cinder"} 11228151808
ceph_rbd_image_bytes_provisioned{image="volume-c718dd75-b6f5-4680-b3b4-e962b96b6a6a",snapshot="snapshot-c8b1822d-9f4c-4deb-b872-0e59124f8954",cluster="ceph",pool="cinder"} 214748364800
Steps to Reproduce Issue
Create a snapshot on a volume and observe duplicated entries in /var/lib/prometheus/node-exporter/rbd.prom
Versions Report
deepsea 0.8.6 salt-master 2018.3.0 (Oxygen) salt-minion 2018.3.0 (Oxygen)
Here is a fix #1540