Package io.sentry
Class SentryOptions
- java.lang.Object
-
- io.sentry.SentryOptions
-
public class SentryOptions extends java.lang.Object
Sentry SDK options
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SentryOptions.BeforeBreadcrumbCallback
The BeforeBreadcrumb callbackstatic interface
SentryOptions.BeforeSendCallback
The BeforeSend callbackstatic class
SentryOptions.Proxy
static class
SentryOptions.RequestSize
static interface
SentryOptions.TracesSamplerCallback
The traces sampler callback.
-
Constructor Summary
Constructors Constructor Description SentryOptions()
SentryOptions ctor It adds and set default things
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addEventProcessor(@NotNull EventProcessor eventProcessor)
Adds an event processorvoid
addIgnoredExceptionForType(@NotNull java.lang.Class<? extends java.lang.Throwable> exceptionType)
Adds exception type to the list of ignored exceptions.void
addInAppExclude(@NotNull java.lang.String exclude)
Adds an inApp excludevoid
addInAppInclude(@NotNull java.lang.String include)
Adds an inApp includevoid
addIntegration(@NotNull Integration integration)
Adds an integrationvoid
addScopeObserver(@NotNull IScopeObserver observer)
Adds a Scope observervoid
addTracingOrigin(@NotNull java.lang.String tracingOrigin)
Adds an origin to which `sentry-trace` header should be sent in HTTP integrations.static @NotNull SentryOptions
from(@NotNull PropertiesProvider propertiesProvider, @NotNull ILogger logger)
CreatesSentryOptions
from properties provided by aPropertiesProvider
.@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()
Deprecated.use {getMaxCacheItems()
}int
getConnectionTimeoutMillis()
Returns the connection timeout in milliseconds.@NotNull SentryLevel
getDiagnosticLevel()
Returns the minimum LogLevel@Nullable java.lang.String
getDist()
Sets the distribution@Nullable 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 processorslong
getFlushTimeoutMillis()
Returns the flush timeout in millis@Nullable javax.net.ssl.HostnameVerifier
getHostnameVerifier()
Returns HostnameVerifier@NotNull java.util.Set<java.lang.Class<? extends java.lang.Throwable>>
getIgnoredExceptionsForType()
Returns the list of exception classes that once captured will not be sent to Sentry asSentryEvent
.@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 interfacelong
getMaxAttachmentSize()
Returns the maximum attachment size for each attachment in MiB.int
getMaxBreadcrumbs()
Returns the max Breadcrumbs Default is 100int
getMaxCacheItems()
The max cache items for capping the number of events Default is 30int
getMaxQueueSize()
Returns the Max queue size@NotNull SentryOptions.RequestSize
getMaxRequestBodySize()
int
getMaxSpans()
Returns the maximum number of spans that can be attached to single transaction.@Nullable java.lang.String
getOutboxPath()
Returns the outbox path if cacheDirPath is set@Nullable java.lang.String
getProguardUuid()
Returns a Proguard UUID.@Nullable SentryOptions.Proxy
getProxy()
Returns the proxy if setint
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 millislong
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 java.util.List<java.lang.String>
getTracingOrigins()
Returns a list of origins to which `sentry-trace` header should be sent in HTTP integrations.@NotNull ITransportFactory
getTransportFactory()
Returns the TransportFactory interface@NotNull ITransportGate
getTransportGate()
Returns the TransportGate interfaceboolean
isAttachServerName()
Returns if SDK automatically resolves and attaches server name to events.boolean
isAttachStacktrace()
Checks if the AttachStacktrace is enabled or notboolean
isAttachThreads()
Checks if the AttachThreads is enabled or notboolean
isDebug()
Check if debug mode is ON Default is OFFboolean
isEnableAutoSessionTracking()
Returns if the automatic session tracking is enabled or notboolean
isEnableDeduplication()
Returns if event deduplication is turned on.boolean
isEnableExternalConfiguration()
Returns if loading properties from external sources is enabled.boolean
isEnableNdk()
Check if NDK is ON or OFF Default is ONboolean
isEnableScopeSync()
Returns if the Java to NDK Scope sync is enabledboolean
isEnableSessionTracking()
Deprecated.boolean
isEnableShutdownHook()
True if ShutdownHookIntegration is enabled, false otherwise.boolean
isEnableUncaughtExceptionHandler()
Checks if the default UncaughtExceptionHandlerIntegration is enabled or not.boolean
isSendDefaultPii()
boolean
isTraceSampling()
Note: this is an experimental API and will be removed without notice.boolean
isTracingEnabled()
Returns if tracing should be enabled.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 disabledvoid
setAttachThreads(boolean attachThreads)
Sets the attachThreads to enabled or disabledvoid
setBeforeBreadcrumb(@Nullable SentryOptions.BeforeBreadcrumbCallback beforeBreadcrumb)
Sets the beforeBreadcrumb callbackvoid
setBeforeSend(@Nullable SentryOptions.BeforeSendCallback beforeSend)
Sets the beforeSend callbackvoid
setCacheDirPath(@Nullable java.lang.String cacheDirPath)
Sets the cache dir.void
setCacheDirSize(int cacheDirSize)
Deprecated.use {setCacheDirSize(int)
}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 OFFvoid
setDiagnosticLevel(@Nullable SentryLevel diagnosticLevel)
Sets the minimum LogLevel if null, it uses the default min.void
setDist(@Nullable java.lang.String dist)
Sets the distributionvoid
setDistinctId(@Nullable java.lang.String distinctId)
Sets the distinct Idvoid
setDsn(@Nullable java.lang.String dsn)
Sets the DSNvoid
setEnableAutoSessionTracking(boolean enableAutoSessionTracking)
Enable or disable the automatic session trackingvoid
setEnableDeduplication(@Nullable java.lang.Boolean enableDeduplication)
Enables or disables event deduplication.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 OFFvoid
setEnableScopeSync(boolean enableScopeSync)
Enables or not the Java to NDK Scope syncvoid
setEnableSessionTracking(boolean enableSessionTracking)
Deprecated.void
setEnableShutdownHook(boolean enableShutdownHook)
Enables or disable ShutdownHookIntegration.void
setEnableUncaughtExceptionHandler(@Nullable java.lang.Boolean enableUncaughtExceptionHandler)
Enable or disable the default UncaughtExceptionHandlerIntegration.void
setEnvelopeDiskCache(@Nullable IEnvelopeCache envelopeDiskCache)
Sets the EnvelopeCache interfacevoid
setEnvelopeReader(@Nullable IEnvelopeReader envelopeReader)
void
setEnvironment(@Nullable java.lang.String environment)
Sets the environmentvoid
setFlushTimeoutMillis(long flushTimeoutMillis)
Sets the flush timeout in millisvoid
setHostnameVerifier(@Nullable javax.net.ssl.HostnameVerifier hostnameVerifier)
Set custom HostnameVerifiervoid
setLogger(@Nullable ILogger logger)
Sets the Logger interface if null, logger will be NoOpvoid
setMaxAttachmentSize(long maxAttachmentSize)
Sets the max attachment size for each attachment in bytes.void
setMaxBreadcrumbs(int maxBreadcrumbs)
Sets the max breadcrumbs Default is 100void
setMaxCacheItems(int maxCacheItems)
Sets the max cache items for capping the number of eventsvoid
setMaxQueueSize(int maxQueueSize)
Sets the max queue size if maxQueueSize is bigger than 0void
setMaxRequestBodySize(@NotNull SentryOptions.RequestSize maxRequestBodySize)
void
setMaxSpans(int maxSpans)
Sets the maximum number of spans that can be attached to single transaction.void
setProguardUuid(@Nullable java.lang.String proguardUuid)
Sets a Proguard UUID.void
setProxy(@Nullable SentryOptions.Proxy proxy)
Sets the proxyvoid
setReadTimeoutMillis(int readTimeoutMillis)
Sets the read timeout in millisecondsvoid
setRelease(@Nullable java.lang.String release)
Sets the releasevoid
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 objectvoid
setSendDefaultPii(boolean sendDefaultPii)
void
setSentryClientName(@Nullable java.lang.String sentryClientName)
Sets the Sentry client namevoid
setSerializer(@Nullable ISerializer serializer)
Sets the Serializer interface if null, Serializer will be NoOpvoid
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 millisvoid
setShutdownTimeout(long shutdownTimeoutMillis)
Sets the shutdown timeout in Millis Default is 2000 = 2svoid
setSslSocketFactory(@Nullable javax.net.ssl.SSLSocketFactory sslSocketFactory)
Set custom SSLSocketFactory that is trusted to self-signed certificatesvoid
setTag(@NotNull java.lang.String key, @NotNull java.lang.String value)
Sets a tag that is applied to all events and transactions.void
setTraceSampling(boolean traceSampling)
Note: this is an experimental API and will be removed without notice.void
setTracesSampler(@Nullable SentryOptions.TracesSamplerCallback tracesSampler)
Sets the callback used to determine if transaction is sampled.void
setTracesSampleRate(@Nullable java.lang.Double tracesSampleRate)
Sets the tracesSampleRate Can be anything between 0.0 and 1.0 or null (default), to disable it.void
setTransportFactory(@Nullable ITransportFactory transportFactory)
Sets the TransportFactory interfacevoid
setTransportGate(@Nullable ITransportGate transportGate)
Sets the TransportGate interface
-
-
-
Method Detail
-
from
@NotNull public static @NotNull SentryOptions from(@NotNull @NotNull PropertiesProvider propertiesProvider, @NotNull @NotNull ILogger logger)
CreatesSentryOptions
from properties provided by aPropertiesProvider
.- Parameters:
propertiesProvider
- the properties provider- Returns:
- the sentry options
-
addEventProcessor
public void addEventProcessor(@NotNull @NotNull EventProcessor eventProcessor)
Adds an event processor- Parameters:
eventProcessor
- the event processor
-
getEventProcessors
@NotNull public @NotNull java.util.List<EventProcessor> getEventProcessors()
Returns the list of event processors- Returns:
- the event processor list
-
addIntegration
public void addIntegration(@NotNull @NotNull Integration integration)
Adds an integration- Parameters:
integration
- the integration
-
getIntegrations
@NotNull public @NotNull java.util.List<Integration> getIntegrations()
Returns the list of integrations- Returns:
- the integration list
-
getDsn
@Nullable public @Nullable java.lang.String getDsn()
Returns the DSN- Returns:
- the DSN or null if not set
-
setDsn
public void setDsn(@Nullable @Nullable java.lang.String dsn)
Sets the DSN- Parameters:
dsn
- the DSN
-
isDebug
public boolean isDebug()
Check if debug mode is ON Default is OFF- Returns:
- true if ON or false otherwise
-
setDebug
public void setDebug(@Nullable @Nullable java.lang.Boolean debug)
Sets the debug mode to ON or OFF Default is OFF- Parameters:
debug
- true if ON or false otherwise
-
getLogger
@NotNull public @NotNull ILogger getLogger()
Returns the Logger interface- Returns:
- the logger
-
setLogger
public void setLogger(@Nullable @Nullable ILogger logger)
Sets the Logger interface if null, logger will be NoOp- Parameters:
logger
- the logger interface
-
getDiagnosticLevel
@NotNull public @NotNull SentryLevel getDiagnosticLevel()
Returns the minimum LogLevel- Returns:
- the log level
-
setDiagnosticLevel
public void setDiagnosticLevel(@Nullable @Nullable SentryLevel diagnosticLevel)
Sets the minimum LogLevel if null, it uses the default min. LogLevel Default is DEBUG- Parameters:
diagnosticLevel
- the log level
-
getSerializer
@NotNull public @NotNull ISerializer getSerializer()
Returns the Serializer interface- Returns:
- the serializer
-
setSerializer
public void setSerializer(@Nullable @Nullable ISerializer serializer)
Sets the Serializer interface if null, Serializer will be NoOp- Parameters:
serializer
- the serializer
-
getEnvelopeReader
@NotNull public @NotNull IEnvelopeReader getEnvelopeReader()
-
setEnvelopeReader
public void setEnvelopeReader(@Nullable @Nullable IEnvelopeReader envelopeReader)
-
isEnableNdk
public boolean isEnableNdk()
Check if NDK is ON or OFF Default is ON- Returns:
- true if ON or false otherwise
-
setEnableNdk
public void setEnableNdk(boolean enableNdk)
Sets NDK to ON or OFF- Parameters:
enableNdk
- true if ON or false otherwise
-
getShutdownTimeout
public long getShutdownTimeout()
Returns the shutdown timeout in Millis- Returns:
- the timeout in Millis
-
setShutdownTimeout
public void setShutdownTimeout(long shutdownTimeoutMillis)
Sets the shutdown timeout in Millis Default is 2000 = 2s- Parameters:
shutdownTimeoutMillis
- the shutdown timeout in millis
-
getSentryClientName
@Nullable public @Nullable java.lang.String getSentryClientName()
Returns the Sentry client name- Returns:
- the Sentry client name or null if not set
-
setSentryClientName
public void setSentryClientName(@Nullable @Nullable java.lang.String sentryClientName)
Sets the Sentry client name- Parameters:
sentryClientName
- the Sentry client name
-
getBeforeSend
@Nullable public @Nullable SentryOptions.BeforeSendCallback getBeforeSend()
Returns the BeforeSend callback- Returns:
- the beforeSend callback or null if not set
-
setBeforeSend
public void setBeforeSend(@Nullable @Nullable SentryOptions.BeforeSendCallback beforeSend)
Sets the beforeSend callback- Parameters:
beforeSend
- the beforeSend callback
-
getBeforeBreadcrumb
@Nullable public @Nullable SentryOptions.BeforeBreadcrumbCallback getBeforeBreadcrumb()
Returns the beforeBreadcrumb callback- Returns:
- the beforeBreadcrumb callback or null if not set
-
setBeforeBreadcrumb
public void setBeforeBreadcrumb(@Nullable @Nullable SentryOptions.BeforeBreadcrumbCallback beforeBreadcrumb)
Sets the beforeBreadcrumb callback- Parameters:
beforeBreadcrumb
- the beforeBreadcrumb callback
-
getCacheDirPath
@Nullable public @Nullable java.lang.String getCacheDirPath()
Returns the cache dir. path if set- Returns:
- the cache dir. path or null if not set
-
getOutboxPath
@Nullable public @Nullable java.lang.String getOutboxPath()
Returns the outbox path if cacheDirPath is set- Returns:
- the outbox path or null if not set
-
setCacheDirPath
public void setCacheDirPath(@Nullable @Nullable java.lang.String cacheDirPath)
Sets the cache dir. path- Parameters:
cacheDirPath
- the cache dir. path
-
getCacheDirSize
@Deprecated public int getCacheDirSize()
Deprecated.use {getMaxCacheItems()
}Returns the cache dir. size Default is 30- Returns:
- the cache dir. size
-
setCacheDirSize
@Deprecated public void setCacheDirSize(int cacheDirSize)
Deprecated.use {setCacheDirSize(int)
}Sets the cache dir. size Default is 30- Parameters:
cacheDirSize
- the cache dir. size
-
getMaxBreadcrumbs
public int getMaxBreadcrumbs()
Returns the max Breadcrumbs Default is 100- Returns:
- the max breadcrumbs
-
setMaxBreadcrumbs
public void setMaxBreadcrumbs(int maxBreadcrumbs)
Sets the max breadcrumbs Default is 100- Parameters:
maxBreadcrumbs
- the max breadcrumbs
-
getRelease
@Nullable public @Nullable java.lang.String getRelease()
Returns the release- Returns:
- the release or null if not set
-
setRelease
public void setRelease(@Nullable @Nullable java.lang.String release)
Sets the release- Parameters:
release
- the release
-
getEnvironment
@Nullable public @Nullable java.lang.String getEnvironment()
Returns the environment- Returns:
- the environment or null if not set
-
setEnvironment
public void setEnvironment(@Nullable @Nullable java.lang.String environment)
Sets the environment- Parameters:
environment
- the environment
-
getProxy
@Nullable public @Nullable SentryOptions.Proxy getProxy()
Returns the proxy if set- Returns:
- the proxy or null if not set
-
setProxy
public void setProxy(@Nullable @Nullable SentryOptions.Proxy proxy)
Sets the proxy- Parameters:
proxy
- the proxy
-
getSampleRate
@Nullable public @Nullable java.lang.Double getSampleRate()
Returns the sample rate Default is null (disabled)- Returns:
- the sample rate
-
setSampleRate
public void setSampleRate(java.lang.Double sampleRate)
Sets the sampleRate Can be anything between 0.01 and 1.0 or null (default), to disable it.- Parameters:
sampleRate
- the sample rate
-
getTracesSampleRate
@Nullable public @Nullable java.lang.Double getTracesSampleRate()
Returns the traces sample rate Default is null (disabled)- Returns:
- the sample rate
-
setTracesSampleRate
public void setTracesSampleRate(@Nullable @Nullable java.lang.Double tracesSampleRate)
Sets the tracesSampleRate Can be anything between 0.0 and 1.0 or null (default), to disable it.- Parameters:
tracesSampleRate
- the sample rate
-
getTracesSampler
@Nullable public @Nullable SentryOptions.TracesSamplerCallback getTracesSampler()
Returns the callback used to determine if transaction is sampled.- Returns:
- the callback
-
setTracesSampler
public void setTracesSampler(@Nullable @Nullable SentryOptions.TracesSamplerCallback tracesSampler)
Sets the callback used to determine if transaction is sampled.- Parameters:
tracesSampler
- the callback
-
getInAppExcludes
@NotNull public @NotNull java.util.List<java.lang.String> getInAppExcludes()
the list of inApp excludes- Returns:
- the inApp excludes list
-
addInAppExclude
public void addInAppExclude(@NotNull @NotNull java.lang.String exclude)
Adds an inApp exclude- Parameters:
exclude
- the inApp exclude module/package
-
getInAppIncludes
@NotNull public @NotNull java.util.List<java.lang.String> getInAppIncludes()
Returns the inApp includes list- Returns:
- the inApp includes list
-
addInAppInclude
public void addInAppInclude(@NotNull @NotNull java.lang.String include)
Adds an inApp include- Parameters:
include
- the inApp include module/package
-
getTransportFactory
@NotNull public @NotNull ITransportFactory getTransportFactory()
Returns the TransportFactory interface- Returns:
- the transport factory
-
setTransportFactory
public void setTransportFactory(@Nullable @Nullable ITransportFactory transportFactory)
Sets the TransportFactory interface- Parameters:
transportFactory
- the transport factory
-
getDist
@Nullable public @Nullable java.lang.String getDist()
Sets the distribution- Returns:
- the distribution or null if not set
-
setDist
public void setDist(@Nullable @Nullable java.lang.String dist)
Sets the distribution- Parameters:
dist
- the distribution
-
getTransportGate
@NotNull public @NotNull ITransportGate getTransportGate()
Returns the TransportGate interface- Returns:
- the transport gate
-
setTransportGate
public void setTransportGate(@Nullable @Nullable ITransportGate transportGate)
Sets the TransportGate interface- Parameters:
transportGate
- the transport gate
-
isAttachStacktrace
public boolean isAttachStacktrace()
Checks if the AttachStacktrace is enabled or not- Returns:
- true if enabled or false otherwise
-
setAttachStacktrace
public void setAttachStacktrace(boolean attachStacktrace)
Sets the attachStacktrace to enabled or disabled- Parameters:
attachStacktrace
- true if enabled or false otherwise
-
isAttachThreads
public boolean isAttachThreads()
Checks if the AttachThreads is enabled or not- Returns:
- true if enabled or false otherwise
-
setAttachThreads
public void setAttachThreads(boolean attachThreads)
Sets the attachThreads to enabled or disabled- Parameters:
attachThreads
- true if enabled or false otherwise
-
isEnableAutoSessionTracking
public boolean isEnableAutoSessionTracking()
Returns if the automatic session tracking is enabled or not- Returns:
- true if enabled or false otherwise
-
setEnableAutoSessionTracking
public void setEnableAutoSessionTracking(boolean enableAutoSessionTracking)
Enable or disable the automatic session tracking- Parameters:
enableAutoSessionTracking
- true if enabled or false otherwise
-
isEnableSessionTracking
@Deprecated @ScheduledForRemoval public boolean isEnableSessionTracking()
Deprecated.
-
setEnableSessionTracking
@Deprecated @ScheduledForRemoval public void setEnableSessionTracking(boolean enableSessionTracking)
Deprecated.
-
getServerName
@Nullable public @Nullable java.lang.String getServerName()
Gets the default server name to be used in Sentry events.- Returns:
- the default server name or null if none set
-
setServerName
public void setServerName(@Nullable @Nullable java.lang.String serverName)
Sets the default server name to be used in Sentry events.- Parameters:
serverName
- the default server name or null if none should be used
-
isAttachServerName
public boolean isAttachServerName()
Returns if SDK automatically resolves and attaches server name to events.- Returns:
- true if enabled false if otherwise
-
setAttachServerName
public void setAttachServerName(boolean attachServerName)
Sets if SDK should automatically resolve and attache server name to events.- Parameters:
attachServerName
- true if enabled false if otherwise
-
getSessionTrackingIntervalMillis
public long getSessionTrackingIntervalMillis()
Returns the session tracking interval in millis- Returns:
- the interval in millis
-
setSessionTrackingIntervalMillis
public void setSessionTrackingIntervalMillis(long sessionTrackingIntervalMillis)
Sets the session tracking interval in millis- Parameters:
sessionTrackingIntervalMillis
- the interval in millis
-
getDistinctId
@Internal @Nullable public @Nullable java.lang.String getDistinctId()
Returns the distinct Id- Returns:
- the distinct Id
-
setDistinctId
@Internal public void setDistinctId(@Nullable @Nullable java.lang.String distinctId)
Sets the distinct Id- Parameters:
distinctId
- the distinct Id
-
getFlushTimeoutMillis
public long getFlushTimeoutMillis()
Returns the flush timeout in millis- Returns:
- the timeout in millis
-
setFlushTimeoutMillis
public void setFlushTimeoutMillis(long flushTimeoutMillis)
Sets the flush timeout in millis- Parameters:
flushTimeoutMillis
- the timeout in millis
-
isEnableUncaughtExceptionHandler
public boolean isEnableUncaughtExceptionHandler()
Checks if the default UncaughtExceptionHandlerIntegration is enabled or not.- Returns:
- true if enabled or false otherwise.
-
getEnableUncaughtExceptionHandler
@Nullable public @Nullable java.lang.Boolean getEnableUncaughtExceptionHandler()
Checks if the default UncaughtExceptionHandlerIntegration is enabled or disabled or not set.- Returns:
- true if enabled, false otherwise or null if not set.
-
setEnableUncaughtExceptionHandler
public void setEnableUncaughtExceptionHandler(@Nullable @Nullable java.lang.Boolean enableUncaughtExceptionHandler)
Enable or disable the default UncaughtExceptionHandlerIntegration.- Parameters:
enableUncaughtExceptionHandler
- true if enabled or false otherwise.
-
getConnectionTimeoutMillis
public int getConnectionTimeoutMillis()
Returns the connection timeout in milliseconds.- Returns:
- the connectionTimeoutMillis
-
setConnectionTimeoutMillis
public void setConnectionTimeoutMillis(int connectionTimeoutMillis)
Sets the connection timeout in milliseconds.- Parameters:
connectionTimeoutMillis
- the connectionTimeoutMillis
-
getReadTimeoutMillis
public int getReadTimeoutMillis()
Returns the read timeout in milliseconds- Returns:
- the readTimeoutMillis
-
setReadTimeoutMillis
public void setReadTimeoutMillis(int readTimeoutMillis)
Sets the read timeout in milliseconds- Parameters:
readTimeoutMillis
- the readTimeoutMillis
-
getEnvelopeDiskCache
@NotNull public @NotNull IEnvelopeCache getEnvelopeDiskCache()
Returns the EnvelopeCache interface- Returns:
- the EnvelopeCache object
-
setEnvelopeDiskCache
public void setEnvelopeDiskCache(@Nullable @Nullable IEnvelopeCache envelopeDiskCache)
Sets the EnvelopeCache interface- Parameters:
envelopeDiskCache
- the EnvelopeCache object
-
getMaxQueueSize
public int getMaxQueueSize()
Returns the Max queue size- Returns:
- the max queue size
-
setMaxQueueSize
public void setMaxQueueSize(int maxQueueSize)
Sets the max queue size if maxQueueSize is bigger than 0- Parameters:
maxQueueSize
- max queue size
-
getSdkVersion
@Nullable public @Nullable SdkVersion getSdkVersion()
Returns the SdkVersion object- Returns:
- the SdkVersion object or null
-
getSslSocketFactory
@Nullable public @Nullable javax.net.ssl.SSLSocketFactory getSslSocketFactory()
Returns SSLSocketFactory- Returns:
- SSLSocketFactory object or null
-
setSslSocketFactory
public void setSslSocketFactory(@Nullable @Nullable javax.net.ssl.SSLSocketFactory sslSocketFactory)
Set custom SSLSocketFactory that is trusted to self-signed certificates- Parameters:
sslSocketFactory
- SSLSocketFactory object
-
getHostnameVerifier
@Nullable public @Nullable javax.net.ssl.HostnameVerifier getHostnameVerifier()
Returns HostnameVerifier- Returns:
- HostnameVerifier objecr or null
-
setHostnameVerifier
public void setHostnameVerifier(@Nullable @Nullable javax.net.ssl.HostnameVerifier hostnameVerifier)
Set custom HostnameVerifier- Parameters:
hostnameVerifier
- the HostnameVerifier
-
setSdkVersion
@Internal public void setSdkVersion(@Nullable @Nullable SdkVersion sdkVersion)
Sets the SdkVersion object- Parameters:
sdkVersion
- the SdkVersion object or null
-
isSendDefaultPii
public boolean isSendDefaultPii()
-
setSendDefaultPii
public void setSendDefaultPii(boolean sendDefaultPii)
-
addScopeObserver
public void addScopeObserver(@NotNull @NotNull IScopeObserver observer)
Adds a Scope observer- Parameters:
observer
- the Observer
-
isEnableScopeSync
public boolean isEnableScopeSync()
Returns if the Java to NDK Scope sync is enabled- Returns:
- true if enabled or false otherwise
-
setEnableScopeSync
public void setEnableScopeSync(boolean enableScopeSync)
Enables or not the Java to NDK Scope sync- Parameters:
enableScopeSync
- true if enabled or false otherwise
-
isEnableExternalConfiguration
public boolean isEnableExternalConfiguration()
Returns if loading properties from external sources is enabled.- Returns:
- true if enabled or false otherwise
-
setEnableExternalConfiguration
public void setEnableExternalConfiguration(boolean enableExternalConfiguration)
Enables loading options from external sources like sentry.properties file or environment variables, system properties.- Parameters:
enableExternalConfiguration
- true if enabled or false otherwise
-
getTags
@NotNull public @NotNull java.util.Map<java.lang.String,java.lang.String> getTags()
Returns tags applied to all events and transactions.- Returns:
- the tags map
-
setTag
public void setTag(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.String value)
Sets a tag that is applied to all events and transactions.- Parameters:
key
- the keyvalue
- the value
-
getMaxAttachmentSize
public long getMaxAttachmentSize()
Returns the maximum attachment size for each attachment in MiB.- Returns:
- the maximum attachment size in MiB.
-
setMaxAttachmentSize
public void setMaxAttachmentSize(long maxAttachmentSize)
Sets the max attachment size for each attachment in bytes. Default is 20 MiB. Please also check the maximum attachment size of Relay to make sure your attachments don't get discarded there: https://docs.sentry.io/product/relay/options/- Parameters:
maxAttachmentSize
- the max attachment size in bytes.
-
isEnableDeduplication
public boolean isEnableDeduplication()
Returns if event deduplication is turned on.- Returns:
- if event deduplication is turned on.
-
setEnableDeduplication
public void setEnableDeduplication(@Nullable @Nullable java.lang.Boolean enableDeduplication)
Enables or disables event deduplication.- Parameters:
enableDeduplication
- true if enabled false otherwise
-
isTracingEnabled
public boolean isTracingEnabled()
Returns if tracing should be enabled. If tracing is disabled, starting transactions returnsNoOpTransaction
.- Returns:
- if tracing is enabled.
-
getIgnoredExceptionsForType
@NotNull public @NotNull java.util.Set<java.lang.Class<? extends java.lang.Throwable>> getIgnoredExceptionsForType()
Returns the list of exception classes that once captured will not be sent to Sentry asSentryEvent
.- Returns:
- the list of exception classes that once captured will not be sent to Sentry as
SentryEvent
.
-
addIgnoredExceptionForType
public void addIgnoredExceptionForType(@NotNull @NotNull java.lang.Class<? extends java.lang.Throwable> exceptionType)
Adds exception type to the list of ignored exceptions.- Parameters:
exceptionType
- - the exception type
-
getMaxSpans
@Experimental public int getMaxSpans()
Returns the maximum number of spans that can be attached to single transaction.- Returns:
- the maximum number of spans that can be attached to single transaction.
-
setMaxSpans
@Experimental public void setMaxSpans(int maxSpans)
Sets the maximum number of spans that can be attached to single transaction.- Parameters:
maxSpans
- maximum number of spans that can be attached to single transaction.
-
isEnableShutdownHook
public boolean isEnableShutdownHook()
True if ShutdownHookIntegration is enabled, false otherwise.- Returns:
- true if enabled or false otherwise.
-
setEnableShutdownHook
public void setEnableShutdownHook(boolean enableShutdownHook)
Enables or disable ShutdownHookIntegration.- Parameters:
enableShutdownHook
- true if enabled or false otherwise.
-
getMaxCacheItems
public int getMaxCacheItems()
The max cache items for capping the number of events Default is 30- Returns:
- the maxCacheItems
-
setMaxCacheItems
public void setMaxCacheItems(int maxCacheItems)
Sets the max cache items for capping the number of events- Parameters:
maxCacheItems
- the maxCacheItems
-
getMaxRequestBodySize
@NotNull public @NotNull SentryOptions.RequestSize getMaxRequestBodySize()
-
setMaxRequestBodySize
public void setMaxRequestBodySize(@NotNull @NotNull SentryOptions.RequestSize maxRequestBodySize)
-
isTraceSampling
@Experimental public boolean isTraceSampling()
Note: this is an experimental API and will be removed without notice.
-
setTraceSampling
@Experimental public void setTraceSampling(boolean traceSampling)
Note: this is an experimental API and will be removed without notice.- Parameters:
traceSampling
- - if trace sampling should be enabled
-
getTracingOrigins
@NotNull public @NotNull java.util.List<java.lang.String> getTracingOrigins()
Returns a list of origins to which `sentry-trace` header should be sent in HTTP integrations.- Returns:
- the list of origins
-
addTracingOrigin
public void addTracingOrigin(@NotNull @NotNull java.lang.String tracingOrigin)
Adds an origin to which `sentry-trace` header should be sent in HTTP integrations.- Parameters:
tracingOrigin
- - the tracing origin
-
getProguardUuid
@Nullable public @Nullable java.lang.String getProguardUuid()
Returns a Proguard UUID.- Returns:
- the Proguard UUIDs.
-
setProguardUuid
public void setProguardUuid(@Nullable @Nullable java.lang.String proguardUuid)
Sets a Proguard UUID.- Parameters:
proguardUuid
- - the Proguard UUID
-
-