From: Wido den Hollander Date: Wed, 29 Nov 2017 08:07:23 +0000 (+0100) Subject: mgr/influx: Send fsid as a tag to Influx to identify cluster X-Git-Tag: v13.0.2~804^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b71a8919c705834d9e669731c2ac83c52715b5b;p=ceph.git mgr/influx: Send fsid as a tag to Influx to identify cluster This allows for multiple Ceph clusters to send their data to the same Influx database. Using the fsid values for different clusters can be queried from Influx Signed-off-by: Wido den Hollander --- diff --git a/src/pybind/mgr/influx/module.py b/src/pybind/mgr/influx/module.py index 7d08f663c03e..5f71c6171480 100644 --- a/src/pybind/mgr/influx/module.py +++ b/src/pybind/mgr/influx/module.py @@ -26,6 +26,9 @@ class Module(MgrModule): self.event = Event() self.run = True + def get_fsid(self): + return self.get('mon_map')['fsid'] + def get_latest(self, daemon_type, daemon_name, stat): data = self.get_counter(daemon_type, daemon_name, stat)[stat] if data: @@ -55,7 +58,7 @@ class Module(MgrModule): "pool_name": pool['name'], "pool_id": pool['id'], "type_instance": df_type, - "mgr_id": self.get_mgr_id(), + "fsid": self.get_fsid() }, "time": datetime.utcnow().isoformat() + 'Z', "fields": { @@ -83,7 +86,8 @@ class Module(MgrModule): "tags": { "ceph_daemon": daemon, "type_instance": path, - "host": metadata['hostname'] + "host": metadata['hostname'], + "fsid": self.get_fsid() }, "time": datetime.utcnow().isoformat() + 'Z', "fields": {