galexrt / extended-ceph-exporter

A Prometheus exporter to provide "extended" metrics about a Ceph cluster's running components (e.g., RGW).
Apache License 2.0
5 stars 1 forks source link

Bucket tenants and rbd usage by namespace support #5

Open maxheyer opened 2 weeks ago

maxheyer commented 2 weeks ago

Hi,

as we have already discussed, the exporter should support multi-tenancy for rgw buckets and rbd usage.

I suggest the following changes: rgw_buckets should contain a tenant if it exists

new metrics: rbd_size_provisioned_bytes(pool="", namespace="", image="") 0 rbd_size_used_bytes(pool="", namespace="", image="") 0

galexrt commented 4 days ago

The rbd volume size is accessible via the Ceph go bindings but I haven't seen a direct call to get the used bytes. Looking at Ceph's rbd du cli command code there seems to be more done than just a "single API call." I have to see if it is possible to easily "copy"/call the code in/from Go.

Additionally I haven't found any field that mentions the namespace nor tenant in the volume/image info returned by the Ceph go bindings GetImage call. Does the namespace/tenant show up in the rbd info VOLUME_NAME command output? If so, please post the output here so I can see where that info might come from, thanks!

maxheyer commented 4 days ago

You must add the namespace information to all rbd commands, just as you do for the pool:: rbd du --pool POOL_NAME --namespace NAMESPACE rbd info VOLUME_NAME --pool POOL_NAME -namespace NAMESPACE

rbd image 'IMAGE_NAME':
    size 8 GiB in 2048 objects
    order 22 (4 MiB objects)
    snapshot_count: 0
    id: IMAGE_ID
    block_name_prefix: rbd_data.PREFIX
    format: 2
    features: layering
    op_features:
    flags:
    create_timestamp: Sun Dec 17 02:48:55 2023
    access_timestamp: Sun Dec 17 02:48:55 2023
    modify_timestamp: Sun Dec 17 02:48:55 2023
galexrt commented 4 days ago

I see, so I'll probably end up doing something similar for the rbd "module" as with RGW multi realm.