mirror of
https://github.com/ceph/ceph
synced 2025-02-22 18:47:18 +00:00
prometheus: Implement rgw_metadata metric
This maps rgw id to its hostname and ceph version running on the node. Signed-off-by: Boris Ranto <branto@redhat.com>
This commit is contained in:
parent
ee263196a0
commit
c7cbc24803
@ -98,6 +98,8 @@ OSD_STATS = ['apply_latency_ms', 'commit_latency_ms']
|
||||
|
||||
POOL_METADATA = ('pool_id', 'name')
|
||||
|
||||
RGW_METADATA = ('id', 'hostname', 'ceph_version')
|
||||
|
||||
DISK_OCCUPATION = ('instance', 'device', 'ceph_daemon')
|
||||
|
||||
|
||||
@ -193,6 +195,13 @@ class Metrics(object):
|
||||
POOL_METADATA
|
||||
)
|
||||
|
||||
metrics['rgw_metadata'] = Metric(
|
||||
'untyped',
|
||||
'rgw_metadata',
|
||||
'RGW Metadata',
|
||||
RGW_METADATA
|
||||
)
|
||||
|
||||
metrics['pg_total'] = Metric(
|
||||
'gauge',
|
||||
'pg_total',
|
||||
@ -508,6 +517,18 @@ class Module(MgrModule):
|
||||
for pool in osd_map['pools']:
|
||||
self.metrics.append('pool_metadata', 1, (pool['pool'], pool['pool_name']))
|
||||
|
||||
# Populate rgw_metadata
|
||||
for key, value in servers.items():
|
||||
service_id, service_type = key
|
||||
if service_type != 'rgw':
|
||||
continue
|
||||
hostname, version = value
|
||||
self.metrics.append(
|
||||
'rgw_metadata',
|
||||
1,
|
||||
(service_id, hostname, version)
|
||||
)
|
||||
|
||||
def collect(self):
|
||||
self.get_health()
|
||||
self.get_df()
|
||||
|
Loading…
Reference in New Issue
Block a user