Adds Sentry Performance Monitoring Capabilities#18496
Conversation
|
| App Name | WordPress |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr18496-704e77f | |
| Commit | 704e77f | |
| Direct Download | wordpress-prototype-build-pr18496-704e77f.apk |
|
| App Name | Jetpack |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr18496-704e77f | |
| Commit | 704e77f | |
| Direct Download | jetpack-prototype-build-pr18496-704e77f.apk |
ParaskP7
left a comment
There was a problem hiding this comment.
👋 @oguzkocer !
I have reviewed this PR as per the instructions, everything LGTM and in par with WCAndroid. Good job bringing Sentry's performance monitoring to WPAndroid and making it configurable via Firebase remote config! 🌟 💯 🥇
Admittedly I don't know how we should test this implementation. The implementation is unit tested and following the implementation from WCAndroid, so I am hopeful that it will work. However, if there is a good way to test this, I'd like to do that before we merge the PR.
Same! 😊
PS: All I did is verifying that the Firebase related wp_android_performance_monitoring_sample_rate remote config has been indeed created and has the expected parameter values.
@wzieba I'd love to hear your thoughts on testing since you worked on this for WCAndroid. Thanks in advance!
This! ⬆️
PS: I am going to approve this PR, just to unblock it, but getting @wzieba input before merging is very welcome.
| private const val VALID_SAMPLE_RATE = 0.01 | ||
| private const val INVALID_SAMPLE_RATE = 0.0 | ||
|
|
||
| class WPPerformanceMonitoringConfigTest { |
There was a problem hiding this comment.
Praise (❤️): Awesome work on the tests, many thanks for covering as many scenarios as possible! 🥇
There was a problem hiding this comment.
I borrowed 3/4 of these tests from @wzieba's implementation ❤️
| companion object { | ||
| private const val PERFORMANCE_MONITORING_SAMPLE_RATE_KEY = "wp_android_performance_monitoring_sample_rate" | ||
|
|
||
| const val OPEN_WEB_LINKS_WITH_JETPACK_FLOW_FREQUENCY_KEY = "open_web_links_with_jetpack_flow_frequency" |
There was a problem hiding this comment.
Minor (🔍): Not related to your change, but maybe we should consider making this constant private as well. Feel free to totally ignore this comment. 😊
|
😞 Ah, this just got merged due to auto-merged being enabled. I usually don't check for auto-merge being enabled on such PRs, especially when extra feedback is waited upon, apologies @oguzkocer , I should have checked anyway! 😭 |
|
👋 I don't see anything blocking in this PR so I think the merge was safe! What I could suggest is:
sentry {
tracingInstrumentation {
enabled = true
features = [io.sentry.android.gradle.extensions.InstrumentationFeature.DATABASE]
}
}About testing: Sentry adds default transactions for all activities and start of the app. I'm installing the app now to check if the integration works. |
|
I also see that the network interceptor was added automatically by Sentry. It's good but not perfect - adding our own network interceptor allows us to specify our own
A sample I see that Sentry also enables, by default, database operations spans, but I think they're safe to leave as it is. |



This PR adds Sentry Performance Monitoring capabilities that's managed through a Firebase remote config. It's disabled for debug builds as well as for users who has tracking disabled. It's also disabled by default and will only work if we set the
wp_android_performance_monitoring_sample_rateremote config value in the range of0 < sampleRate <=1.0. The implementation closely follows it's counterpart fromWooCommerce-Androidproject.The remote config value is set to
0.0for now. I intend to keep it this way and let folks who are interested in this capability to change the sampling rate as they see fit. This is to prevent us from accidentally sending too many events and getting a large bill to pay.Note that the
TransactionLaunchers and transactions for HTTP requests are out of scope for this PR. We'll need to have an internal discussion about that before we add them.To test:
Admittedly I don't know how we should test this implementation. The implementation is unit tested and following the implementation from WCAndroid, so I am hopeful that it will work. However, if there is a good way to test this, I'd like to do that before we merge the PR.
@wzieba I'd love to hear your thoughts on testing since you worked on this for WCAndroid. Thanks in advance!
Regression Notes
Potential unintended areas of impact
N/A
What I did to test those areas of impact (or what existing automated tests I relied on)
N/A
What automated tests I added (or what prevented me from doing so)
N/A
PR submission checklist:
RELEASE-NOTES.txtif necessary.UI Changes testing checklist: