jeggy
06/24/2025, 8:53 AMval rawRouteAttribute = AttributeKey<String>("rawRouteAttribute")
environment.monitor.subscribe(Routing.RoutingCallStarted) { call ->
call.attributes.put(rawRouteAttribute, call.route.parent.toString())
}
and then retrieving it back in the CallLogging
plugin. But when looking at java flight recording, we can see that in our call logging plugin we get a few java.lang.IllegalStateException
exceptions and with the message of No instance for key AttributeKey: rawRouteAttribute
.
I'm wondering in what cases does ktor use the CallLogging
plugin but not fire a RoutingCallStarted
event?Aleksei Tirman [JB]
06/25/2025, 7:58 AMRoutingCallStarted
event only when one of the routes is resolved. So you might get the IllegalStateException
when the server responds with an implicit 404 status code.jeggy
06/25/2025, 8:31 AM