Android SDK configuration

The docs have several obscurities re. configuration:

  1. What are the DSN options (passed as query parameters, I assume)?
  2. What are the sentry.properties options?
  3. Where does the sentry block go: in build.gradle or app/build.gradle and where exactly in that?
    Some options/properties are mentioned but there doesn’t seem to be a complete list anywhere.

Of particular interest to me is buffer.enabled because that sounds like a possible reason why I am not getting my uncaught exceptions. The docs call it a DSN option, which suggests it goes in the DSN URL but why would you send to the server an option that is clearly local? It’s not the server that flushes, it’s the device, so this is confusing.

1. What are the DSN options (passed as query parameters, I assume)?

You can ignore them unless you really need them. 99% of users will not need to pass any options other than the DSN. They can be found in the sentry-java documentation.

2. What are the sentry.properties options?

There are two sentry.properties files but I assume you are referring to the one from the upload process. The file supports all the configuration parameters of the sentry-cli executable and the parameters can be found in the docs here: Configuration and Authentication | Sentry Documentation

3. Where does the sentry block go: in build.gradle or app/build.gradle and where exactly in that?

If you mean the optional sentry { ... } block it goes anywhere in your app/build.gradle. You should not need it most of the time however.

The docs call it a DSN option, which suggests it goes in the DSN URL but why would you send to the server an option that is clearly local?

The DSN is not sent to the server, it’s strictly used locally to configure the client.

Thanks. After reading the sentry-java configuration section I have a few more questions/observations:

  1. the entire “Graceful Shutdown (Advanced)” section is duplicated
  2. no mention of buffer.enabled; maybe it is obsolete and one should use buffer.size=0 instead?
  3. it is unclear how buffer.size and async.queuesize interact

To re-answer your first two about DSN options and (Java SDK) sentry.properties options: those are just two (of multiple) ways to configure the Sentry Java SDK. They all allow the same options to be used, they are just different methods of setting the configuration that suit different users better depending on their use case, as outlined in “Configuration Methods”: https://docs.sentry.io/clients/java/config/#configuration-methods

I’ll add a better note to try and clarify that.

For the latest questions:

  1. Graceful shutdown is not quite duplicated. Those are two distinct subsections: one to do with async sends and one to do with buffering data to disk. The option names and detail differ, as you can see in the documentation, and each can be tuned independently.
  2. buffer.enabled=false is indeed used for fully disabling disk buffering on Android. This will mean uncaught exceptions are likely not sent if your application crashes, though. I’ll fix the mention of “DSN option,” that used to be the only configuration method and this is a leftover artifact.
  3. Buffer size is the number of events allowed to be kept on disk, async size is the number in memory.

But most importantly, like Armin said, almost all of these options are very rarely needed. Is there something specific you are trying to accomplish that I can help with?

My problem is that I wasn’t getting any uncaught exceptions yesterday (shortly after creating the account) but they seem to be flowing normally today.

Re. the buffer.enabled option, it is mentioned in the Android section but not the java-config section.

One thing to note about uncaught exceptions is that they aren’t necessarily sent the second you re-launch, so you may have to wait 30-60 seconds for them to be sent. This is an implementation detail we can discuss if you’re really interested – because I don’t know of a good way to improve it. :slight_smile:

buffer.enabled is only useful for Android and so it is only described on that page.