🐛 Fix metrics and doc endpoints

This commit is contained in:
Alejandro Alonso 2023-04-05 14:03:55 +02:00 committed by Andrey Antukh
parent 408de63ea3
commit 08c6ebe10c
2 changed files with 9 additions and 9 deletions

View file

@ -89,12 +89,12 @@
(defn- handler
[registry _ respond _]
[registry _]
(let [samples (.metricFamilySamples ^CollectorRegistry registry)
writer (StringWriter.)]
(TextFormat/write004 writer samples)
(respond {:headers {"content-type" TextFormat/CONTENT_TYPE_004}
:body (.toString writer)})))
{:headers {"content-type" TextFormat/CONTENT_TYPE_004}
:body (.toString writer)}))

View file

@ -65,12 +65,12 @@
[methods]
(if (contains? cf/flags :backend-api-doc)
(let [context (prepare-context methods)]
(fn [_ respond _]
(respond {::yrs/status 200
::yrs/body (-> (io/resource "app/templates/api-doc.tmpl")
(tmpl/render context))})))
(fn [_ respond _]
(respond {::yrs/status 404}))))
(fn [_]
{::yrs/status 200
::yrs/body (-> (io/resource "app/templates/api-doc.tmpl")
(tmpl/render context))}))
(fn [_]
{::yrs/status 404})))
(s/def ::routes vector?)