Our team is trying to monitor performance of our Ktor (by Jetbrains) backend application. We are able to attach Elastic APM agent in backend server, and this server is visible at Kibana dashboard as service. But it is not creating transaction automatically for each incoming request. When we manually start a transaction and end it in a specific route, then only it is recording performance for that request. Please help if someone tried this earlier and was able to analyse all request without manual transaction of Elastic APM.
Reference code given below.
val transaction: Transaction = ElasticApm.startTransaction()
try {
transaction.setName("MyTransaction#getApi")
transaction.setType(Transaction.TYPE_REQUEST)
// do your thing...
} catch (e: java.lang.Exception) {
transaction.captureException(e)
throw e
} finally {
transaction.end()
}
I'm not familiar with Ktor, but it seems that it provides a way to intercept routes, which allows to implement a generic wrapper for all incoming transactions: Intercepting Routes | Ktor.
but the drawback is i need to setup transaction information manually,
next thing i need to find is to record request body and response status code.. or can we automate it?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.