zalando / friboo

Utility library for writing microservices in Clojure, with support for Swagger and OAuth
Apache License 2.0
118 stars 16 forks source link

Log warning if handler function returns no status code #74

Open PetrGlad opened 7 years ago

PetrGlad commented 7 years ago

Improvement, additional validation. If handler returns empty response (e.g. nil) no response status is available for statistic's metrics. This causes confusing statistic's metrics like 'some.id..POST' while ''some.id.200.POST'' is expected. I suggest log a warning in this case to help with diagnostics.

Probably this can be implemented as separate middleware but I think simplest ways is just to check this directly in add-metrics-filter inside (swap! status (fn [_] (.getStatus (cast HttpServletResponse response))))

LappleApple commented 7 years ago

Hi @dryewo, any plans to do something here? Maybe @PetrGlad could take it, or we could add a "Help Wanted" label.