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))))
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))))