      (let [request-uri (:uri request)]
        (if (or (.startsWith request-uri (sanitize-uri uri))
                (= request-uri uri))
-         (metrics-json request)
+         (serve-metrics request)
          (handler request))))))

    {:type :counter
     :value (counters/value c)}))


; Utils -----------------------------------------------------------------------
(defn- ensure-leading-slash [s]
  (if (not= \/ (first s))
    (str \/ s)

            [metrics.counters :as counters]
            [metrics.timers :as timers]
            [ring.util.response :refer [header response]]
            [metrics.core :refer [default-registry]]
            [metrics.utils :refer [all-metrics]]
            [cheshire.core :refer [generate-string]]))

