openstack-exporter icon indicating copy to clipboard operation
openstack-exporter copied to clipboard

Add image_created_at metric

Open silentirk opened this issue 1 year ago • 6 comments

This change adds metric glance_image_created_at with unix timestamp of images creation dates.

# HELP openstack_glance_image_created_at image_created_at
# TYPE openstack_glance_image_created_at gauge
openstack_glance_image_created_at{id="781b3762-9469-4cec-b58d-3349e5de4e9c",name="F17-x86_64-cfntools",tenant_id="5ef70662f8b34079a6eddb8da9d75fe8",visibility="public",hidden="false"} 1.414657419e+09
openstack_glance_image_created_at{id="1bea47ed-f6a9-463b-b423-14b9cca9ad27",name="cirros-0.3.2-x86_64-disk",tenant_id="5ef70662f8b34079a6eddb8da9d75fe8",visibility="public",hidden="false"} 1.415380026e+09

This allows to monitor if specific public images in the cloud are being updated in time. Image rotation process usually involves creating of a new image from file, so we check for created_at property rather than updated_at.

silentirk avatar Jan 31 '24 16:01 silentirk

Happy to review, could you please fix the conflicts here?

niedbalski avatar Feb 01 '24 11:02 niedbalski

Done.

silentirk avatar Feb 01 '24 12:02 silentirk

can u please add activated/disabled status?

odnobit avatar Feb 01 '24 12:02 odnobit

can u please add activated/disabled status?

You mean adding label of 'status' for image: active, deactivated, queued, etc? If so, only for new metric, or image_bytes as well? Or something else?

silentirk avatar Feb 01 '24 12:02 silentirk

yeah, I'm talking about new label like status. I think you can add the label to the new metric only

odnobit avatar Feb 01 '24 12:02 odnobit

great, thank you @Silentirk

odnobit avatar Feb 01 '24 13:02 odnobit

Hello @niedbalski ! Could you please review this?

silentirk avatar Feb 27 '24 12:02 silentirk

@niedbalski, can you see it? I'm already using patched version in production, having it in the upstream will be really great.

amarao avatar Mar 14 '24 14:03 amarao