Kamon icon indicating copy to clipboard operation
Kamon copied to clipboard

Add support for `connectionSource` in Akka HTTP 10.2

Open steinybot opened this issue 4 years ago • 3 comments

There are some instrumentations missing for Akka HTTP 10.2.x. See https://github.com/kamon-io/Kamon/discussions/989

steinybot avatar May 14 '21 03:05 steinybot

All the bind* methods have been deprecated since Akka HTTP 10.2.0.

I'm not sure that's correct, I'm seeing deprecations on underlying methods, but bind, bindFlow and bindSync look like they're still in use. That said, we'll definitely look into instrumenting this as well (at some point).

SimunKaracic avatar May 14 '21 07:05 SimunKaracic

They do seem to be deprecated on HttpExt which is what you get back from Http.apply. The migration docs also support this https://doc.akka.io/docs/akka-http/current/migration-guide/migration-guide-10.2.x.html#akka-http-10-1-x-10-2-0.

steinybot avatar May 16 '21 20:05 steinybot

The migration is about using the new ServerBuilder API. The old, deprecated methods even point to the new API: @deprecated("Use Http().newServerAt(...)...bindFlow() to create server bindings.", since = "10.2.0").

The new ServerBuilder api exposes 4 ways of creating a new server: connectionSource, bind, bindFlow, bindSync. All but connectionSource are just calling old methods, and are thus instrumented. The fact that they're calling deprecated code does not mean the themselves are deprecated, only that you should be using this new interface instead of calling the old code directly.

The docs you linked also use Http().newServerAt("localhost", 8080).bind(route), which call methods that are deprecated on HttpExt class.

SimunKaracic avatar May 17 '21 07:05 SimunKaracic