Platform: Android, Kotlin
Version: 1.7.27
I'm attempting to attach HTTP request information to the current context so that it gets logged on the next event. On first glance it appears I can use the HttpInterface and set it using Sentry.getContext().http
However this causes Sentry to stop working entirely, and seeing the logcat exceptions thrown it looks like this is a server-side only interface.
Is there a way to attach HTTP logging information to Android events that will parse well on the Sentry web interface?
@mgray88 hey, could you elaborate a bit more on Sentry to stop working entirely and also to share the logcat/stack trace exceptions? thanks
I can get back to you on the stack trace, but a quick glance at HttpInterface (corrected the link), it uses the javax.servlet package which is not available on Android
@mgray88 yep, this is Java (non-Android only).
I'd suggest having a look at https://github.com/getsentry/sentry-android it's our new Android SDK, still on beta though, it's focused on Android and won't get into these problems.
@marandaneto Right, we needed a stable release though for our production app and the sentry-android 1.x release depends on the base java sdk, so that's kind of where I was going with that.
Do you know if the new sentry-android will support a prettified http display on the web interface similar to how it looks for web projects? I know that maybe kind of obscure as Android errors don't revolve around http issues, but I think it's probably a common enough issue that Android apps will be reporting.
As it is now, we just print the info we need to the log and send the error report. It works, and is similar to most error reporting platforms, but it would be pretty swell if there was a nice printout backed by a defined object :)
@mgray88 sure, stay tuned, a stable release will come soon.
I'd say so through Integrations, we intend to create some default Integrations like for OkHttp, Retrofit, so you can easily add breadcrumbs or set/log` more context and so on.
This new SDK follows the Sentry Unified API, so almost everything you do on other SDKs should be possible on this one as well, of course respecting its platform spec.
@mgray88 hey :) btw sentry-android is stable for a while already.
https://github.com/getsentry/sentry-android/pull/287 Here is a quick draft on how to get HTTP information (eg OkHttp).
This ideally will become a default integration, but you can start from there till we get this done :)
Closing the issue, as it seems like the original issue has been partially resolved or there is a working solution. I'd prefer someone to create a new issue with a fresh description if it's still an issue.
Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it.
Cheers!