
KtorMonitor
Powerful tool to monitor Ktor Client, OkHttp and http4k requests and responses, making it easier to debug and analyze network communication.
✨ Features
📦 Setup (Kotlin Multiplatform) for Ktor Client

kotlin {
sourceSets {
commonMain.dependencies {
implementation("ro.cosminmihu.ktor:ktor-monitor-logging:1.14.4")
}
}
}
For Release Builds (No-Op)
To isolate KtorMonitor from release builds, use the ktor-monitor-logging-no-op variant. This ensures the monitor code is not included in production artifact.
kotlin {
sourceSets {
commonMain.dependencies {
implementation("ro.cosminmihu.ktor:ktor-monitor-logging-no-op:1.14.4")
}
}
}

dependencies {
debugImplementation("ro.cosminmihu.ktor:ktor-monitor-logging:1.14.4")
releaseImplementation("ro.cosminmihu.ktor:ktor-monitor-logging-no-op:1.14.4")
}
For Android minSdk < 26, Core Library Desugaring is required.
Install Ktor Client Plugin
HttpClient {
install(KtorMonitorLogging) {
sanitizeHeader { header -> header == "Authorization" }
filter { request -> !request.url.host.contains("cosminmihu.ro") }
showNotification = true
retentionPeriod = RetentionPeriod.OneHour
maxContentLength = ContentLength.Default
}
}
- - sanitize sensitive headers to avoid their values appearing in the logs
📦 Setup (Android & JVM) for OkHttp

dependencies {
debugImplementation("`ro.cosminmihu.ktor:ktor-monitor-okhttp-interceptor:1.14.4")
releaseImplementation("ro.cosminmihu.ktor:ktor-monitor-okhttp-interceptor-no-op:1.14.4")
}
For Android minSdk < 26, Core Library Desugaring is required.
Install OkHttp Interceptor
OkHttpClient.Builder()
.addNetworkInterceptor(
KtorMonitorInterceptor {
sanitizeHeader { header -> header == "Authorization" }
filter { request -> !request.url.host.contains("cosminmihu.ro") }
showNotification = true
retentionPeriod = RetentionPeriod.OneHour
maxContentLength = ContentLength.Default
}
)
.build()
- - sanitize sensitive headers to avoid their values appearing in the logs
📦 Setup (Android & JVM) for http4k

dependencies {
debugImplementation("ro.cosminmihu.ktor:ktor-monitor-http4k-filter:1.14.4")
releaseImplementation("ro.cosminmihu.ktor:ktor-monitor-http4k-filter-no-op:1.14.4")
}
For Android minSdk < 26, Core Library Desugaring is required.
Install http4k Filter
KtorMonitorFilter {
sanitizeHeader { header -> header == "Authorization" }
filter { request -> !request.uri.host.contains("cosminmihu.ro") }
showNotification = true
retentionPeriod = RetentionPeriod.OneHour
maxContentLength = ContentLength.Default
}.then(JavaHttpClient())
- - sanitize sensitive headers to avoid their values appearing in the logs
🧩 Integration
Add the UI component to your application based on your targeted platform.
Compose Multiplatform (Common)
- Use
KtorMonitor Composable
@Composable
fun Composable() {
KtorMonitor()
}
Android
- If and is granted, the library will display a notification showing a summary of ongoing KTOR activity. Tapping on the notification launches the full .
Desktop (Swing)
- Use
KtorMonitorPanel Swing Panel
fun main() = application {
SwingUtilities.invokeLater {
val frame = JFrame()
frame.add(KtorMonitorPanel, BorderLayout.CENTER)
frame.isVisible = true
}
}
✍️ Feedback
Found a bug or have a feature request? File an issue.
🙌 Acknowledgments
Community discussions on Slack — join us in the channel.
Documentation is available at .
API is available at .
KtorMonitor is available also on JetBrains' .
KtorMonitor on .
AI Skill (for Copilot, Claude, Cursor, ChatGPT and others) is available at .
Some parts of this project are reusing ideas that are originally coming from .
Thanks to ChuckerTeam for Chucker!
Thanks to JetBrains for Ktor and Kotlin!
Medium article:
💸 Sponsors
KtorMonitor is maintained and improved during nights, weekends and whenever team has free time. If you use KtorMonitor in your project, please consider sponsoring us.
You can sponsor us by clicking ♥ Sponsor.

🙏🏻 Credits
KtorMonitor is brought to you by these contributors.