getsentry / getsentry/sentry-java
File I/O Instrumentation with OkHttp Cache enabled
- 主要語言
- Kotlin
- 星號
- 1.4k
- 分支
- 478
- 平均合併
- 3 天 4 小時
- 30 天內合併 PR
- 72
描述
### Problem Statement
When I enabled [caching]() in the OkHttp client and activated File I/O Sentry instrumentation, I observed that the `file.write` span always ends with a `deadline_exceeded` status. This occurs due to the way OkHttp's `DiskLruCache` manages the journal file internally - it keeps the *journalWriter* open until explicitly closed.
Sentry SDK: `8.13.2`
Sentry Gradle Plugin: `5.8.0`
### Solution Brainstorm
Ideally, we want the span to be properly closed each time cached data is flushed (written). Perhaps the Sentry SDK could handle this differently if the File I/O operation originates from the OkHttp cache. Alternatively, it would be beneficial if we could filter this span out, preventing its duration from contributing to the total `ui.load` time.
貢獻指南
研究方向
首先使用 OkHttp 快取和 Sentry File I/O instrumentation 重現問題,然後檢查 DiskLruCache journalWriter 的行為以及 SDK 檔案寫入 span 的生命週期。確認快取寫入在 ui.load 中的表示方式,並將完成定義為消除錯誤的 deadline_exceeded 狀態,同時不遺失有用的 File I/O instrumentation。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- android, kotlin
- 領域
- mobile-dev, observability, performance
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 35/100