-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move the signalsBufferDir
under context.getFilesDir()
#859
Comments
This is handled by the OS when using So I'd say it's better to provide a dir configuration rather than changing it, I think |
@marandaneto do you mean adding a new property to the Before: Lines 20 to 25 in a317b11
After: val signalsBufferDir: File
get() {
val dir = diskBufferingConfig.signalsBufferDir ?: File(cacheStorage.cacheDir, "opentelemetry/signals")
ensureExistingOrThrow(dir)
return dir
} If yes, I'm fine with that too, that would satisfy my goal too. |
Yes |
I agree with @marandaneto and like your proposed solution, @bencehornak. Would you like to contribute it? |
Sure, I'll implement the new property |
At the moment the
signalsBufferDir
, which is used to store un-exported telemetry batches, is stored withincontext.getCacheDir()
:opentelemetry-android/core/src/main/java/io/opentelemetry/android/internal/features/persistence/DiskManager.kt
Lines 20 to 25 in a317b11
opentelemetry-android/services/src/main/java/io/opentelemetry/android/internal/services/CacheStorage.java
Lines 24 to 26 in a317b11
According to the docs there are no persistency guarantees for
context.getCacheDir()
:For those applications, where telemetry is a nice-to-have this sounds like an acceptable trade-off. In my case I cannot afford to lose telemetry because of the internal quirks of the OS, as there might be important business events standing in the device's queue.
So my recommendation is to move the
signalsBufferDir
under the more persistentgetFilesDir()
to prevent telemetry data loss caused by OS clean-ups.The text was updated successfully, but these errors were encountered: