       (dry-mode-warn options)
       (let [tpool (get-thread-pool options)
             pstore (pstore/elasticsearch-path-store es-url options)
+            sort (get-sort-or-not-fn (:sort options))
             processed-data (process-metrics tenant rollups paths cass-hosts
                                             pstore options
                                             remove-obsolete-metrics-processor
                                             tpool)
             obsolete-paths (->> processed-data
                                 (get-paths-from-paths-rollups)
+                                (filter #(:leaf (get @paths-info %)))
                                 (distinct)
-                                (filter #(:leaf (get @paths-info %))))]
+                                (sort))]
         (process-paths tenant obsolete-paths pstore options
                        remove-obsolete-paths-processor)))
     (catch Exception e

        from (timec/to-epoch (time/minus (time/now) (time/seconds threshold)))
        title "Checking metrics"
        paths-rollups (combine-paths-rollups paths [(first rollups)])
        sort (if (:sort options) sort #(do %))]
    (prog/set-progress-bar!
     "[:bar] :percent :done/:total Elapsed :elapseds ETA :etas")
    (prog/config-progress-bar! :width pbar-width)

    (let [tpool (get-thread-pool options)
          mstore (mstore/cassandra-metric-store cass-hosts options)
          pstore (pstore/elasticsearch-path-store es-url options)
          sort (get-sort-or-not-fn (:sort options))
          obsolete-data (->> (get-paths pstore tenant paths
                                        (:exclude-paths options)
                                        (:sort options))
                             (filter-obsolete-metrics mstore tpool tenant
                                                      rollups options)
                             (get-paths-from-paths-rollups)
                             (distinct)
                             (sort))]
      (newline)
      (dorun (map println obsolete-data)))
    (catch Exception e
