akka-http-metrics
akka-http-metrics copied to clipboard
Provide support for HTTP/2
As of today, Akka Http only allows using HTTP2 with bindAndHandleAsync method. Since .recordMetrics returns a flow, I can't use this library with HTTP2 which only takes HttpRequest ⇒ Future[HttpResponse] as handler.
async handler is now part of the API but connections metrics are not supported.
The latest release of Akka HTTP has improvements for HTTP 2. Not sure if it helps
https://doc.akka.io/docs/akka-http/current/release-notes/10.1.x.html#akka-http2-support
Thanks for the notification @bilal-fazlani !
There are no significant changes on the API but I spotted this TODO comment on the Http2Ext that indicates a possible unification with Http API.
At this point the connections metrics could be added for Http2.
Small update on this.
Seems the unification goes the opposite way in akka-http 10.2. It favors the function handler instead of the stream, making it more difficult to access connections metrics
TelemetrySpi has been added to akka-http. akka-http-metrics should provide an implementation