1

In http4s docs there is an example of adding /metrics endpoint to the routes provided by Http4s: https://http4s.org/v0.21/middleware/

All of them are predefined by the library, but I was wondering if there is a possibility of adding custom metrics, but I could not find any information about it.

Does anyone know anything about it?

Krzysztof Atłasik
  • 21,985
  • 6
  • 54
  • 76
fr3ak
  • 493
  • 3
  • 16
  • Provided metric middlewares are just modules of http4s, that you can include in your dependencies. You can define your own middleware however you want. I'd take the prometheus or dropwizard implementations as a guideline and would build upon that. You can find source code of prometheus metrics here: https://github.com/http4s/http4s/tree/master/prometheus-metrics/src/main/scala/org/http4s/metrics/prometheus. Dropwizard metrics are in adjacent package – Andrey Patseev Sep 16 '20 at 17:33

0 Answers0