docs: def collect_metrics():
      """
      Register the decorated function to run for the collect_metrics hook.
      """
      def _register(action):
          handler = Handler.get(action)
          handler.add_predicate(partial(_restricted_hook, 'collect-metrics'))
          return action
      return _register