If you've ever chased a mysterious 401 through a stack of five OkHttp interceptors, you know the pain: HttpLoggingInterceptor shows you the final request — but not which interceptor added, removed, or overwrote that header.
OkTrace fixes exactly that. It logs a diff at every step of the interceptor chain.
What you get
🔍 Per-interceptor diffs — headers added / removed / changed, URL rewrites, method changes, body changes
⏱️ Timings for each step plus total duration
📦 Programmatic access to traces via OkTrace.store.entries
⚙️ Configurable: OkTrace.enabled , OkTrace.logTag , TraceStore.maxEntries
Diff legend:
Symbol Meaning
+ header added
- header removed
~ header / URL / body changed
[pass-through] interceptor changed nothing
Example output
[1] AuthInterceptor · 2ms + Authorization: Bearer •••• [2] HeaderInterceptor · 0ms ~ User-Agent: okhttp → app/2.1 - X-Debug [3] RetryInterceptor · 0ms [pass-through] ← 200 OK · total 184ms
Enter fullscreen mode
Exit fullscreen mode
Now you know instantly…