Skip to content

Commit

Permalink
Add version tags to osd metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmeinhold committed Jun 7, 2023
1 parent df603a9 commit e671a96
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ceph/datadog_checks/ceph/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ def _extract_metrics(self, raw, tags):
devices = { metadata['id']: metadata['devices'] for metadata in raw.get('osd_metadata', []) }
device_ids = { metadata['id']: metadata['device_ids'] for metadata in raw.get('osd_metadata', []) }
device_class = { metadata['id']: metadata['default_device_class'] for metadata in raw.get('osd_metadata', []) }
version = { metadata['id']: metadata['ceph_version_short'] for metadata in raw.get('osd_metadata', []) }
release = { metadata['id']: metadata['ceph_release'] for metadata in raw.get('osd_metadata', []) }

for osdperf in raw_osd_perf['osd_perf_infos']:
local_tags = tags + ['ceph_osd:osd%s' % osdperf['id'], f'ceph_osd_objectstore:{store_type[osdperf["id"]]}', f'ceph_osd_device:{devices[osdperf["id"]]}', f'ceph_osd_device_id:{device_ids[osdperf["id"]]}', f'ceph_osd_device_class:{device_class[osdperf["id"]]}']
local_tags = tags + ['ceph_osd:osd%s' % osdperf['id'], f'ceph_osd_objectstore:{store_type[osdperf["id"]]}', f'ceph_osd_device:{devices[osdperf["id"]]}', f'ceph_osd_device_id:{device_ids[osdperf["id"]]}', f'ceph_osd_device_class:{device_class[osdperf["id"]]}', f'ceph_version:{version[osdperf["id"]]}', f'ceph_release:{release[osdperf["id"]]}']
self._publish(osdperf, self.gauge, ['perf_stats', 'apply_latency_ms'], local_tags)
self._publish(osdperf, self.gauge, ['perf_stats', 'commit_latency_ms'], local_tags)
except (KeyError, TypeError):
Expand Down

0 comments on commit e671a96

Please sign in to comment.