       (.buckets (double-array @histogram-buckets))
       (.namespace app-name)
       (.name "http_request_latency_seconds")
-      (.labelNames (into-array String ["method" "status" "path"]))
+      (.labelNames (into-array String ["method" "status" "statusClass" "path"]))
       (.help "A histogram of the response latency for HTTP requests in seconds.")
       (.register registry)))
 

  (-> (Counter/build)
      (.namespace app-name)
      (.name "http_requests_total")
      (.labelNames (into-array String ["method" "status" "path"]))
      (.help "A counter of the total number of HTTP requests processed.")
      (.register registry)))


(defn- ^Histogram$Child histogram-with-labels [^Histogram histogram label-array] (.labels histogram label-array))

(defn- record-request-metric [counter histogram request-method response-status request-time response-path]
  (let [status-class (str (int (/ response-status 100)) "XX")
        method-label (string/upper-case (name request-method))
        labels (into-array String [method-label (str response-status) status-class response-path])]
    (-> (histogram-with-labels histogram labels) (.observe request-time))
    (-> (counter-with-labels counter labels) (.inc))))

