In this query
If a volume has multiple volume attachments, the LEFT JOIN will make v.id (id of volume) lose its primary key property that it gets from the db; so it is not unique anymore. When you then construct the metric using those values, you end up with two identical metrics which will trigger a panic and crash the whole exporter.
Using:
LEFT JOIN volume_attachment va ON v.id = va.volume_id AND va.deleted = 0 AND va.attach_status = "attached"
Seems to fix it.
In this query
If a volume has multiple volume attachments, the LEFT JOIN will make v.id (id of volume) lose its primary key property that it gets from the db; so it is not unique anymore. When you then construct the metric using those values, you end up with two identical metrics which will trigger a panic and crash the whole exporter.
Using:
LEFT JOIN volume_attachment va ON v.id = va.volume_id AND va.deleted = 0 AND va.attach_status = "attached"Seems to fix it.