public class SentryOptions
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SentryOptions.BeforeBreadcrumbCallback
The BeforeBreadcrumb callback
|
static interface |
SentryOptions.BeforeSendCallback
The BeforeSend callback
|
static class |
SentryOptions.Proxy |
static interface |
SentryOptions.TracesSamplerCallback
The traces sampler callback.
|
| Constructor and Description |
|---|
SentryOptions()
SentryOptions ctor It adds and set default things
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEventProcessor(@NotNull EventProcessor eventProcessor)
Adds an event processor
|
void |
addInAppExclude(@NotNull java.lang.String exclude)
Adds an inApp exclude
|
void |
addInAppInclude(@NotNull java.lang.String include)
Adds an inApp include
|
void |
addIntegration(@NotNull Integration integration)
Adds an integration
|
void |
addScopeObserver(@NotNull IScopeObserver observer)
Adds a Scope observer
|
static @NotNull SentryOptions |
from(@NotNull PropertiesProvider propertiesProvider)
Creates
SentryOptions from properties provided by a PropertiesProvider. |
@Nullable SentryOptions.BeforeBreadcrumbCallback |
getBeforeBreadcrumb()
Returns the beforeBreadcrumb callback
|
@Nullable SentryOptions.BeforeSendCallback |
getBeforeSend()
Returns the BeforeSend callback
|
@Nullable java.lang.String |
getCacheDirPath()
Returns the cache dir.
|
int |
getCacheDirSize()
Returns the cache dir.
|
int |
getConnectionTimeoutMillis()
Returns the connection timeout in milliseconds.
|
@NotNull SentryLevel |
getDiagnosticLevel()
Returns the minimum LogLevel
|
@Nullable java.lang.String |
getDist()
Sets the distribution
|
java.lang.String |
getDistinctId()
Returns the distinct Id
|
@Nullable java.lang.String |
getDsn()
Returns the DSN
|
@Nullable java.lang.Boolean |
getEnableUncaughtExceptionHandler()
Checks if the default UncaughtExceptionHandlerIntegration is enabled or disabled or not set.
|
@NotNull IEnvelopeCache |
getEnvelopeDiskCache()
Returns the EnvelopeCache interface
|
@NotNull IEnvelopeReader |
getEnvelopeReader() |
@Nullable java.lang.String |
getEnvironment()
Returns the environment
|
@NotNull java.util.List<EventProcessor> |
getEventProcessors()
Returns the list of event processors
|
long |
getFlushTimeoutMillis()
Returns the flush timeout in millis
|
@Nullable javax.net.ssl.HostnameVerifier |
getHostnameVerifier()
Returns HostnameVerifier
|
@NotNull java.util.List<java.lang.String> |
getInAppExcludes()
the list of inApp excludes
|
@NotNull java.util.List<java.lang.String> |
getInAppIncludes()
Returns the inApp includes list
|
@NotNull java.util.List<Integration> |
getIntegrations()
Returns the list of integrations
|
@NotNull ILogger |
getLogger()
Returns the Logger interface
|
long |
getMaxAttachmentSize()
Returns the maximum attachment size for each attachment in MiB.
|
int |
getMaxBreadcrumbs()
Returns the max Breadcrumbs Default is 100
|
int |
getMaxQueueSize()
Returns the Max queue size
|
@Nullable java.lang.String |
getOutboxPath()
Returns the outbox path if cacheDirPath is set
|
@Nullable SentryOptions.Proxy |
getProxy()
Returns the proxy if set
|
int |
getReadTimeoutMillis()
Returns the read timeout in milliseconds
|
@Nullable java.lang.String |
getRelease()
Returns the release
|
@Nullable java.lang.Double |
getSampleRate()
Returns the sample rate Default is null (disabled)
|
@Nullable SdkVersion |
getSdkVersion()
Returns the SdkVersion object
|
@Nullable java.lang.String |
getSentryClientName()
Returns the Sentry client name
|
@NotNull ISerializer |
getSerializer()
Returns the Serializer interface
|
@Nullable java.lang.String |
getServerName()
Gets the default server name to be used in Sentry events.
|
long |
getSessionTrackingIntervalMillis()
Returns the session tracking interval in millis
|
long |
getShutdownTimeout()
Returns the shutdown timeout in Millis
|
@Nullable javax.net.ssl.SSLSocketFactory |
getSslSocketFactory()
Returns SSLSocketFactory
|
@NotNull java.util.Map<java.lang.String,java.lang.String> |
getTags()
Returns tags applied to all events and transactions.
|
@Nullable SentryOptions.TracesSamplerCallback |
getTracesSampler()
Returns the callback used to determine if transaction is sampled.
|
@Nullable java.lang.Double |
getTracesSampleRate()
Returns the traces sample rate Default is null (disabled)
|
@NotNull ITransportFactory |
getTransportFactory()
Returns the TransportFactory interface
|
@NotNull ITransportGate |
getTransportGate()
Returns the TransportGate interface
|
boolean |
isAttachServerName()
Returns if SDK automatically resolves and attaches server name to events.
|
boolean |
isAttachStacktrace()
Checks if the AttachStacktrace is enabled or not
|
boolean |
isAttachThreads()
Checks if the AttachThreads is enabled or not
|
boolean |
isDebug()
Check if debug mode is ON Default is OFF
|
boolean |
isEnableExternalConfiguration()
Returns if loading properties from external sources is enabled.
|
boolean |
isEnableNdk()
Check if NDK is ON or OFF Default is ON
|
boolean |
isEnableScopeSync()
Returns if the Java to NDK Scope sync is enabled
|
boolean |
isEnableSessionTracking()
Returns if the automatic session tracking is enabled or not
|
boolean |
isEnableUncaughtExceptionHandler()
Checks if the default UncaughtExceptionHandlerIntegration is enabled or not.
|
boolean |
isSendDefaultPii() |
void |
setAttachServerName(boolean attachServerName)
Sets if SDK should automatically resolve and attache server name to events.
|
void |
setAttachStacktrace(boolean attachStacktrace)
Sets the attachStacktrace to enabled or disabled
|
void |
setAttachThreads(boolean attachThreads)
Sets the attachThreads to enabled or disabled
|
void |
setBeforeBreadcrumb(@Nullable SentryOptions.BeforeBreadcrumbCallback beforeBreadcrumb)
Sets the beforeBreadcrumb callback
|
void |
setBeforeSend(@Nullable SentryOptions.BeforeSendCallback beforeSend)
Sets the beforeSend callback
|
void |
setCacheDirPath(@Nullable java.lang.String cacheDirPath)
Sets the cache dir.
|
void |
setCacheDirSize(int cacheDirSize)
Sets the cache dir.
|
void |
setConnectionTimeoutMillis(int connectionTimeoutMillis)
Sets the connection timeout in milliseconds.
|
void |
setDebug(@Nullable java.lang.Boolean debug)
Sets the debug mode to ON or OFF Default is OFF
|
void |
setDiagnosticLevel(@Nullable SentryLevel diagnosticLevel)
Sets the minimum LogLevel if null, it uses the default min.
|
void |
setDist(@Nullable java.lang.String dist)
Sets the distribution
|
void |
setDistinctId(java.lang.String distinctId)
Sets the distinct Id
|
void |
setDsn(@Nullable java.lang.String dsn)
Sets the DSN
|
void |
setEnableExternalConfiguration(boolean enableExternalConfiguration)
Enables loading options from external sources like sentry.properties file or environment
variables, system properties.
|
void |
setEnableNdk(boolean enableNdk)
Sets NDK to ON or OFF
|
void |
setEnableScopeSync(boolean enableScopeSync)
Enables or not the Java to NDK Scope sync
|
void |
setEnableSessionTracking(boolean enableSessionTracking)
Enable or disable the automatic session tracking
|
void |
setEnableUncaughtExceptionHandler(@Nullable java.lang.Boolean enableUncaughtExceptionHandler)
Enable or disable the default UncaughtExceptionHandlerIntegration.
|
void |
setEnvelopeDiskCache(@Nullable IEnvelopeCache envelopeDiskCache)
Sets the EnvelopeCache interface
|
void |
setEnvelopeReader(@Nullable IEnvelopeReader envelopeReader) |
void |
setEnvironment(@Nullable java.lang.String environment)
Sets the environment
|
void |
setFlushTimeoutMillis(long flushTimeoutMillis)
Sets the flush timeout in millis
|
void |
setHostnameVerifier(@Nullable javax.net.ssl.HostnameVerifier hostnameVerifier)
Set custom HostnameVerifier
|
void |
setLogger(@Nullable ILogger logger)
Sets the Logger interface if null, logger will be NoOp
|
void |
setMaxAttachmentSize(long maxAttachmentSize)
Sets the max attachment size for each attachment in bytes.
|
void |
setMaxBreadcrumbs(int maxBreadcrumbs)
Sets the max breadcrumbs Default is 100
|
void |
setMaxQueueSize(int maxQueueSize)
Sets the max queue size if maxQueueSize is bigger than 0
|
void |
setProxy(@Nullable SentryOptions.Proxy proxy)
Sets the proxy
|
void |
setReadTimeoutMillis(int readTimeoutMillis)
Sets the read timeout in milliseconds
|
void |
setRelease(@Nullable java.lang.String release)
Sets the release
|
void |
setSampleRate(java.lang.Double sampleRate)
Sets the sampleRate Can be anything between 0.01 and 1.0 or null (default), to disable it.
|
void |
setSdkVersion(@Nullable SdkVersion sdkVersion)
Sets the SdkVersion object
|
void |
setSendDefaultPii(boolean sendDefaultPii) |
void |
setSentryClientName(@Nullable java.lang.String sentryClientName)
Sets the Sentry client name
|
void |
setSerializer(@Nullable ISerializer serializer)
Sets the Serializer interface if null, Serializer will be NoOp
|
void |
setServerName(@Nullable java.lang.String serverName)
Sets the default server name to be used in Sentry events.
|
void |
setSessionTrackingIntervalMillis(long sessionTrackingIntervalMillis)
Sets the session tracking interval in millis
|
void |
setShutdownTimeout(long shutdownTimeoutMillis)
Sets the shutdown timeout in Millis Default is 2000 = 2s
|
void |
setSslSocketFactory(@Nullable javax.net.ssl.SSLSocketFactory sslSocketFactory)
Set custom SSLSocketFactory that is trusted to self-signed certificates
|
void |
setTag(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets a tag that is applied to all events and transactions.
|
void |
setTracesSampler(@Nullable SentryOptions.TracesSamplerCallback tracesSampler)
Sets the callback used to determine if transaction is sampled.
|
void |
setTracesSampleRate(java.lang.Double tracesSampleRate)
Sets the tracesSampleRate Can be anything between 0.01 and 1.0 or null (default), to disable
it.
|
void |
setTransportFactory(@Nullable ITransportFactory transportFactory)
Sets the TransportFactory interface
|
void |
setTransportGate(@Nullable ITransportGate transportGate)
Sets the TransportGate interface
|
public SentryOptions()
@NotNull public static @NotNull SentryOptions from(@NotNull @NotNull PropertiesProvider propertiesProvider)
SentryOptions from properties provided by a PropertiesProvider.propertiesProvider - the properties providerpublic void addEventProcessor(@NotNull
@NotNull EventProcessor eventProcessor)
eventProcessor - the event processor@NotNull public @NotNull java.util.List<EventProcessor> getEventProcessors()
public void addIntegration(@NotNull
@NotNull Integration integration)
integration - the integration@NotNull public @NotNull java.util.List<Integration> getIntegrations()
@Nullable public @Nullable java.lang.String getDsn()
public void setDsn(@Nullable
@Nullable java.lang.String dsn)
dsn - the DSNpublic boolean isDebug()
public void setDebug(@Nullable
@Nullable java.lang.Boolean debug)
debug - true if ON or false otherwise@NotNull public @NotNull ILogger getLogger()
public void setLogger(@Nullable
@Nullable ILogger logger)
logger - the logger interface@NotNull public @NotNull SentryLevel getDiagnosticLevel()
public void setDiagnosticLevel(@Nullable
@Nullable SentryLevel diagnosticLevel)
diagnosticLevel - the log level@NotNull public @NotNull ISerializer getSerializer()
public void setSerializer(@Nullable
@Nullable ISerializer serializer)
serializer - the serializer@NotNull public @NotNull IEnvelopeReader getEnvelopeReader()
public void setEnvelopeReader(@Nullable
@Nullable IEnvelopeReader envelopeReader)
public boolean isEnableNdk()
public void setEnableNdk(boolean enableNdk)
enableNdk - true if ON or false otherwisepublic long getShutdownTimeout()
public void setShutdownTimeout(long shutdownTimeoutMillis)
shutdownTimeoutMillis - the shutdown timeout in millis@Nullable public @Nullable java.lang.String getSentryClientName()
public void setSentryClientName(@Nullable
@Nullable java.lang.String sentryClientName)
sentryClientName - the Sentry client name@Nullable public @Nullable SentryOptions.BeforeSendCallback getBeforeSend()
public void setBeforeSend(@Nullable
@Nullable SentryOptions.BeforeSendCallback beforeSend)
beforeSend - the beforeSend callback@Nullable public @Nullable SentryOptions.BeforeBreadcrumbCallback getBeforeBreadcrumb()
public void setBeforeBreadcrumb(@Nullable
@Nullable SentryOptions.BeforeBreadcrumbCallback beforeBreadcrumb)
beforeBreadcrumb - the beforeBreadcrumb callback@Nullable public @Nullable java.lang.String getCacheDirPath()
@Nullable public @Nullable java.lang.String getOutboxPath()
public void setCacheDirPath(@Nullable
@Nullable java.lang.String cacheDirPath)
cacheDirPath - the cache dir. pathpublic int getCacheDirSize()
public void setCacheDirSize(int cacheDirSize)
cacheDirSize - the cache dir. sizepublic int getMaxBreadcrumbs()
public void setMaxBreadcrumbs(int maxBreadcrumbs)
maxBreadcrumbs - the max breadcrumbs@Nullable public @Nullable java.lang.String getRelease()
public void setRelease(@Nullable
@Nullable java.lang.String release)
release - the release@Nullable public @Nullable java.lang.String getEnvironment()
public void setEnvironment(@Nullable
@Nullable java.lang.String environment)
environment - the environment@Nullable public @Nullable SentryOptions.Proxy getProxy()
public void setProxy(@Nullable
@Nullable SentryOptions.Proxy proxy)
proxy - the proxy@Nullable public @Nullable java.lang.Double getSampleRate()
public void setSampleRate(java.lang.Double sampleRate)
sampleRate - the sample rate@Nullable public @Nullable java.lang.Double getTracesSampleRate()
public void setTracesSampleRate(java.lang.Double tracesSampleRate)
tracesSampleRate - the sample rate@Nullable public @Nullable SentryOptions.TracesSamplerCallback getTracesSampler()
public void setTracesSampler(@Nullable
@Nullable SentryOptions.TracesSamplerCallback tracesSampler)
tracesSampler - the callback@NotNull public @NotNull java.util.List<java.lang.String> getInAppExcludes()
public void addInAppExclude(@NotNull
@NotNull java.lang.String exclude)
exclude - the inApp exclude module/package@NotNull public @NotNull java.util.List<java.lang.String> getInAppIncludes()
public void addInAppInclude(@NotNull
@NotNull java.lang.String include)
include - the inApp include module/package@NotNull public @NotNull ITransportFactory getTransportFactory()
public void setTransportFactory(@Nullable
@Nullable ITransportFactory transportFactory)
transportFactory - the transport factory@Nullable public @Nullable java.lang.String getDist()
public void setDist(@Nullable
@Nullable java.lang.String dist)
dist - the distribution@NotNull public @NotNull ITransportGate getTransportGate()
public void setTransportGate(@Nullable
@Nullable ITransportGate transportGate)
transportGate - the transport gatepublic boolean isAttachStacktrace()
public void setAttachStacktrace(boolean attachStacktrace)
attachStacktrace - true if enabled or false otherwisepublic boolean isAttachThreads()
public void setAttachThreads(boolean attachThreads)
attachThreads - true if enabled or false otherwisepublic boolean isEnableSessionTracking()
public void setEnableSessionTracking(boolean enableSessionTracking)
enableSessionTracking - true if enabled or false otherwise@Nullable public @Nullable java.lang.String getServerName()
public void setServerName(@Nullable
@Nullable java.lang.String serverName)
serverName - the default server name or null if none should be usedpublic boolean isAttachServerName()
public void setAttachServerName(boolean attachServerName)
attachServerName - true if enabled false if otherwisepublic long getSessionTrackingIntervalMillis()
public void setSessionTrackingIntervalMillis(long sessionTrackingIntervalMillis)
sessionTrackingIntervalMillis - the interval in millis@ApiStatus.Internal public java.lang.String getDistinctId()
@ApiStatus.Internal public void setDistinctId(java.lang.String distinctId)
distinctId - the distinct Idpublic long getFlushTimeoutMillis()
public void setFlushTimeoutMillis(long flushTimeoutMillis)
flushTimeoutMillis - the timeout in millispublic boolean isEnableUncaughtExceptionHandler()
@Nullable public @Nullable java.lang.Boolean getEnableUncaughtExceptionHandler()
public void setEnableUncaughtExceptionHandler(@Nullable
@Nullable java.lang.Boolean enableUncaughtExceptionHandler)
enableUncaughtExceptionHandler - true if enabled or false otherwise.public int getConnectionTimeoutMillis()
public void setConnectionTimeoutMillis(int connectionTimeoutMillis)
connectionTimeoutMillis - the connectionTimeoutMillispublic int getReadTimeoutMillis()
public void setReadTimeoutMillis(int readTimeoutMillis)
readTimeoutMillis - the readTimeoutMillis@NotNull public @NotNull IEnvelopeCache getEnvelopeDiskCache()
public void setEnvelopeDiskCache(@Nullable
@Nullable IEnvelopeCache envelopeDiskCache)
envelopeDiskCache - the EnvelopeCache objectpublic int getMaxQueueSize()
public void setMaxQueueSize(int maxQueueSize)
maxQueueSize - max queue size@Nullable public @Nullable SdkVersion getSdkVersion()
@Nullable public @Nullable javax.net.ssl.SSLSocketFactory getSslSocketFactory()
public void setSslSocketFactory(@Nullable
@Nullable javax.net.ssl.SSLSocketFactory sslSocketFactory)
sslSocketFactory - SSLSocketFactory object@Nullable public @Nullable javax.net.ssl.HostnameVerifier getHostnameVerifier()
public void setHostnameVerifier(@Nullable
@Nullable javax.net.ssl.HostnameVerifier hostnameVerifier)
hostnameVerifier - the HostnameVerifier@ApiStatus.Internal
public void setSdkVersion(@Nullable
@Nullable SdkVersion sdkVersion)
sdkVersion - the SdkVersion object or nullpublic boolean isSendDefaultPii()
public void setSendDefaultPii(boolean sendDefaultPii)
public void addScopeObserver(@NotNull
@NotNull IScopeObserver observer)
observer - the Observerpublic boolean isEnableScopeSync()
public void setEnableScopeSync(boolean enableScopeSync)
enableScopeSync - true if enabled or false otherwisepublic boolean isEnableExternalConfiguration()
public void setEnableExternalConfiguration(boolean enableExternalConfiguration)
enableExternalConfiguration - true if enabled or false otherwise@NotNull public @NotNull java.util.Map<java.lang.String,java.lang.String> getTags()
public void setTag(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.String value)
key - the keyvalue - the valuepublic long getMaxAttachmentSize()
public void setMaxAttachmentSize(long maxAttachmentSize)
maxAttachmentSize - the max attachment size in bytes.