From ad55fe1e0f074ba6928317413c9b419cd9d5a3ba Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 25 Jul 2019 17:04:34 -0500 Subject: [PATCH] mgr/telemetry: force re-opt-in if the report contents change Signed-off-by: Sage Weil (cherry picked from commit 143e1f046909cb68d769ebbbaa80cb7106879997) Conflicts: doc/rados/operations/health-checks.rst We don't have the crash module, hence neither its docs. src/pybind/mgr/telemetry/module.py Issues due to context --- doc/rados/operations/health-checks.rst | 33 ++++++++++++++++++++++++++ src/pybind/mgr/telemetry/module.py | 18 ++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/doc/rados/operations/health-checks.rst b/doc/rados/operations/health-checks.rst index aa4ba460f73f1..2eb4623beb1ba 100644 --- a/doc/rados/operations/health-checks.rst +++ b/doc/rados/operations/health-checks.rst @@ -584,3 +584,36 @@ happen if they are misplaced or degraded (see *PG_AVAILABILITY* and You can manually initiate a scrub of a clean PG with:: ceph pg deep-scrub + + +Miscellaneous +------------- + +TELEMETRY_CHANGED +_________________ + +Telemetry has been enabled, but the contents of the telemetry report +have changed since that time, so telemetry reports will not be sent. + +The Ceph developers periodically revise the telemetry feature to +include new and useful information, or to remove information found to +be useless or sensitive. If any new information is included in the +report, Ceph will require the administrator to re-enable telemetry to +ensure they have an opportunity to (re)review what information will be +shared. + +To review the contents of the telemetry report,:: + + ceph telemetry show + +Note that the telemetry report consists of several optional channels +that may be independently enabled or disabled. For more information, see +:ref:`telemetry`. + +To re-enable telemetry (and make this warning go away),:: + + ceph telemetry on + +To disable telemetry (and make this warning go away),:: + + ceph telemetry off diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 5497ba785b336..d68974a01bac6 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -416,6 +416,18 @@ class Module(MgrModule): self.run = False self.event.set() + def refresh_health_checks(self): + health_checks = {} + if self.enabled and self.last_opt_revision < LAST_REVISION_RE_OPT_IN: + health_checks['TELEMETRY_CHANGED'] = { + 'severity': 'warning', + 'summary': 'Telemetry requires re-opt-in', + 'detail': [ + 'telemetry report includes new information; must re-opt-in (or out)' + ] + } + self.set_health_checks(health_checks) + def serve(self): self.init_module_config() self.run = True @@ -424,6 +436,12 @@ class Module(MgrModule): self.event.wait(10) while self.run: + self.refresh_health_checks() + + if self.last_opt_revision < LAST_REVISION_RE_OPT_IN: + self.log.debug('Not sending report until user re-opts-in') + self.event.wait(1800) + continue if not self.config['enabled']: self.log.debug('Not sending report until configured to do so') self.event.wait(1800) -- 2.39.5