Merge pull request #21383 from b-ranto/wip-mgr-rgw-metadata

prometheus: Implement rgw_metadata metric

Reviewed-by: John Spray <john.spray@redhat.com>
Reviewed-by: Jan Fajerski <jfajerski@suse.com>
This commit is contained in:
Boris Ranto 2018-04-18 12:46:00 +02:00 committed by GitHub
commit a2eea2427a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()