Production & Tooling
This page maps each stage of a Koin project to the tool that covers it. Koin itself covers build time, development and tests. For production, Kotzilla (the company that builds Koin) offers an optional monitoring platform.
Everything in Koin works without any of the tools on this page except the ones that ship with Koin. Pick what matches your need.
Which tool for which need
| Stage | Need | Tool | Ships with Koin |
|---|---|---|---|
| Build time | Fail the build on a missing dependency or a wrong qualifier | Compile-Time Safety with the Koin Compiler Plugin | Yes |
| Development | See what Koin creates and resolves | Logging with printLogger() or a platform logger | Yes |
| Development | Navigate between definitions and injection points, see issues in the editor | IDE Plugin for Android Studio and IntelliJ IDEA | No, free plugin by Kotzilla |
| Tests | Check a module configuration without running the app | Verifying Modules with verify() | Yes |
| Tests | Replace definitions with fakes or mocks | Testing with KoinTest | Yes |
| Production | Trace the execution time of chosen functions | @Monitor, with the Kotzilla SDK | Annotation yes, tracing needs the SDK |
| Production | See startup, main thread and background performance issues and crashes from real user sessions | Production Monitoring with the Kotzilla platform | No, Kotzilla service |
Build time
The Koin Compiler Plugin checks your dependency graph during compilation. A missing definition, a missing qualifier or an unknown scope fails the build with a KOIN-Dxxx diagnostic instead of crashing at runtime. This is the first line of defense: see Compile-Time Safety for what is validated and how to set it up.
Development
The Koin logger prints module loading and instance creation. Turn it on with printLogger(Level.DEBUG) or a platform logger (androidLogger(), SLF4J). It writes raw text to the console or Logcat, so it is a debugging aid, not a monitoring tool. See Logging.
The IDE Plugin adds navigation, a tree view of modules and definitions, and configuration checks in the editor.
Tests
verify() checks that every definition in a module can be built, from a plain JUnit test. If you use the Compiler Plugin, compile-time safety already covers most of what verify() checks. See Verifying Modules and Testing.
Production
Compile-time safety and tests catch configuration errors. They don't tell you how the graph behaves on real devices: how long resolutions take at startup, which dependency blocks the main thread, which crash comes from a Koin resolution.
Koin has no production monitoring of its own. The Kotzilla platform covers this need, through the Kotzilla SDK that plugs into the Koin container. See Production Monitoring. The @Monitor annotation extends it to your own functions.
Related
- Compile-Time Safety: what the Compiler Plugin checks at build time.
- Starting Koin: enable and configure the Koin logger.
- Verifying Modules: check a configuration from a test.
- IDE Plugin: navigation and checks in Android Studio and IntelliJ IDEA.
- Production Monitoring: the Kotzilla platform for Koin apps.