Package io.sentry
Class SentryOptions
java.lang.Object
io.sentry.SentryOptions
- Direct Known Subclasses:
SentryProperties
,SentryProperties
Sentry SDK options
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
The BeforeBreadcrumb callbackstatic interface
The BeforeEmitMetric callbackstatic interface
The BeforeEnvelope callbackstatic interface
The BeforeSend callbackstatic interface
The BeforeSendTransaction callbackstatic final class
static interface
The profiles sampler callback.static final class
static enum
static interface
The traces sampler callback. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBundleId
(@Nullable String bundleId) Adds a bundle ID (also known as debugId) representing a source bundle that contains sources for this application.void
addContextTag
(@NotNull String contextTag) Adds context tag name that is applied to Sentry events as Sentry tag.void
addEventProcessor
(@NotNull EventProcessor eventProcessor) Adds an event processorvoid
addIgnoredExceptionForType
(@NotNull Class<? extends Throwable> exceptionType) Adds exception type to the list of ignored exceptions.void
addInAppExclude
(@NotNull String exclude) Adds an inApp excludevoid
addInAppInclude
(@NotNull String include) Adds an inApp includevoid
addIntegration
(@NotNull Integration integration) Adds an integrationvoid
addOptionsObserver
(@NotNull IOptionsObserver observer) Adds a SentryOptions observervoid
addPerformanceCollector
(@NotNull IPerformanceCollector collector) Adds a ICollector.void
addScopeObserver
(@NotNull IScopeObserver observer) Adds a Scope observervoid
addTracingOrigin
(@NotNull String tracingOrigin) Deprecated.static @NotNull SentryOptions
empty()
Creates SentryOptions instance without initializing any of the internal parts.@NotNull IBackpressureMonitor
@Nullable SentryOptions.BeforeBreadcrumbCallback
Returns the beforeBreadcrumb callback@Nullable SentryOptions.BeforeEmitMetricCallback
@Nullable SentryOptions.BeforeEnvelopeCallback
@Nullable SentryOptions.BeforeSendCallback
Returns the BeforeSend callbackReturns the BeforeSendTransaction callbackReturns all configured bundle IDs referencing source code bundles.@Nullable String
Returns the cache dir.@NotNull IClientReportRecorder
Returns a ClientReportRecorder or a NoOp if sending of client reports has been disabled.@NotNull IConnectionStatusProvider
int
Returns the connection timeout in milliseconds.Returns Context tags names applied to Sentry events as Sentry tags.@Nullable SentryOptions.Cron
getCron()
@NotNull SentryDateProvider
Returns the currentSentryDateProvider
that is used to retrieve the current date.@NotNull io.sentry.internal.debugmeta.IDebugMetaLoader
Returns a DebugMetaLoader to load sentry-debug-meta.properties containing ProGuard UUID, source bundle IDs etc.@NotNull SentryLevel
Returns the minimum LogLevel@Nullable String
getDist()
Sets the distribution@Nullable String
Returns the distinct Id@Nullable String
getDsn()
Returns the DSN.@Nullable Boolean
Deprecated.We're removing enableTracing in 8.0@NotNull IEnvelopeCache
Returns the EnvelopeCache interface@NotNull IEnvelopeReader
@Nullable String
Returns the environment@NotNull List<EventProcessor>
Returns the list of event processors@NotNull ISentryExecutorService
Returns the SentryExecutorService@NotNull ExperimentalOptions
long
Returns the flush timeout in millis@NotNull FullyDisplayedReporter
Gets the reporter to call when a screen is fully loaded, used for time-to-full-display spans.List<io.sentry.internal.gestures.GestureTargetLocator>
Returns a list of allGestureTargetLocator
instances used to determine whichUiElement
was part of an user interaction.@Nullable Long
Returns the idle timeout.Returns the list of exception classes that once captured will not be sent to Sentry asSentryEvent
.the list of inApp excludesReturns the inApp includes list@NotNull Instrumenter
Returns the instrumenter used for performance instrumentation@NotNull List<Integration>
Returns the list of integrations@NotNull ILogger
Returns the Logger interface@NotNull IMainThreadChecker
long
Returns the maximum attachment size for each attachment in MiB.int
Returns the max Breadcrumbs Default is 100int
The max cache items for capping the number of events Default is 30int
Returns the max depth for when serializing object graphs using reflection.int
Returns the Max queue size@NotNull SentryOptions.RequestSize
int
Returns the maximum number of spans that can be attached to single transaction.long
Returns the maximum trace file size for each envelope item in bytes.@NotNull io.sentry.internal.modules.IModulesLoader
Returns a ModulesLoader to load external modules (dependencies/packages) of the program.@NotNull List<IOptionsObserver>
Returns the list of SentryOptions observers@Nullable String
Returns the outbox path if cacheDirPath is set@NotNull List<IPerformanceCollector>
Returns the list of ICollectors.@Nullable SentryOptions.ProfilesSamplerCallback
Returns the callback used to determine if a profile is sampled.@Nullable Double
Returns the profiles sample rate.@Nullable String
Returns the profiling traces dir.int
Returns the rate the profiler will sample rates at.@Nullable String
Returns a Proguard UUID.@Nullable SentryOptions.Proxy
getProxy()
Returns the proxy if setint
Returns the read timeout in milliseconds@Nullable String
Returns the release@NotNull ReplayController
@Nullable Double
Returns the sample rate Default is null (disabled)@NotNull List<IScopeObserver>
Returns the list of Scope observers@Nullable SdkVersion
Returns the SdkVersion object@Nullable String
Returns the Sentry client name@NotNull ISerializer
Returns the Serializer interface@Nullable String
Gets the default server name to be used in Sentry events.long
long
Returns the session tracking interval in millislong
Deprecated.use {getShutdownTimeoutMillis()
}long
Returns the shutdown timeout in Millis@Nullable String
@Nullable SSLSocketFactory
Returns SSLSocketFactorygetTags()
Returns tags applied to all events and transactions.Returns a list of origins to which `sentry-trace` header should be sent in HTTP integrations.@Nullable SentryOptions.TracesSamplerCallback
Returns the callback used to determine if transaction is sampled.@Nullable Double
Returns the traces sample rate Default is null (disabled)Deprecated.use {getTracePropagationTargets()
}@NotNull TransactionPerformanceCollector
Gets the performance collector used to collect performance stats while transactions run.@NotNull ITransactionProfiler
Returns the listener interface to perform operations when a transaction is started or ended.@NotNull ITransportFactory
Returns the TransportFactory interface@NotNull ITransportGate
Returns the TransportGate interfacefinal @NotNull List<io.sentry.internal.viewhierarchy.ViewHierarchyExporter>
Returns a list of allViewHierarchyExporter
instances used to export view hierarchy information.boolean
Returns if SDK automatically resolves and attaches server name to events.boolean
Checks if the AttachStacktrace is enabled or notboolean
Checks if the AttachThreads is enabled or notboolean
isDebug()
Check if debug mode is ON Default is OFFboolean
Whether to profile app launches, depending on profilesSampler or profilesSampleRate.boolean
Returns if the automatic session tracking is enabled or notboolean
boolean
Whether Sentry is enabled.boolean
Returns if event deduplication is turned on.boolean
boolean
Returns if loading properties from external sources is enabled.boolean
boolean
Whether to format serialized data, e.g.boolean
boolean
boolean
True if ShutdownHookIntegration is enabled, false otherwise.boolean
boolean
boolean
Gets if the time-to-full-display spans is tracked in navigation transactions.boolean
Checks if the default UncaughtExceptionHandlerIntegration is enabled or not.boolean
boolean
boolean
Checks if printing exceptions by UncaughtExceptionHandler is enabled or disabled.boolean
Returns if profiling is enabled for transactions.boolean
Returns whether sending of client reports has been enabled.boolean
boolean
Whether to send modules containing information about versions.boolean
Whether OPTIONS requests should be traced.boolean
Returns whether the `baggage` header is attached to HTTP client integrations and the `trace` header is attached to envelopes.boolean
Returns if tracing should be enabled.void
merge
(@NotNull ExternalOptions options) Merges with anotherSentryOptions
object.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
setBackpressureMonitor
(@NotNull IBackpressureMonitor backpressureMonitor) void
setBeforeBreadcrumb
(@Nullable SentryOptions.BeforeBreadcrumbCallback beforeBreadcrumb) Sets the beforeBreadcrumb callbackvoid
setBeforeEmitMetricCallback
(@Nullable SentryOptions.BeforeEmitMetricCallback beforeEmitMetricCallback) void
setBeforeEnvelopeCallback
(@Nullable SentryOptions.BeforeEnvelopeCallback beforeEnvelopeCallback) void
setBeforeSend
(@Nullable SentryOptions.BeforeSendCallback beforeSend) Sets the beforeSend callbackvoid
setBeforeSendTransaction
(@Nullable SentryOptions.BeforeSendTransactionCallback beforeSendTransaction) Sets the beforeSendTransaction callbackvoid
setCacheDirPath
(@Nullable String cacheDirPath) Sets the cache dir.void
setConnectionStatusProvider
(@NotNull IConnectionStatusProvider connectionStatusProvider) void
setConnectionTimeoutMillis
(int connectionTimeoutMillis) Sets the connection timeout in milliseconds.void
setCron
(@Nullable SentryOptions.Cron cron) void
setDateProvider
(@NotNull SentryDateProvider dateProvider) Sets theSentryDateProvider
which is used to retrieve the current date.void
setDebug
(boolean debug) Sets the debug mode to ON or OFF Default is OFFvoid
setDebugMetaLoader
(@Nullable io.sentry.internal.debugmeta.IDebugMetaLoader debugMetaLoader) void
setDiagnosticLevel
(@Nullable SentryLevel diagnosticLevel) Sets the minimum LogLevel if null, it uses the default min.void
Sets the distributionvoid
setDistinctId
(@Nullable String distinctId) Sets the distinct Idvoid
Sets the DSNvoid
setEnableAppStartProfiling
(boolean enableAppStartProfiling) Whether to profile app launches, depending on profilesSampler or profilesSampleRate.void
setEnableAutoSessionTracking
(boolean enableAutoSessionTracking) Enable or disable the automatic session trackingvoid
setEnableBackpressureHandling
(boolean enableBackpressureHandling) void
setEnabled
(boolean enabled) Whether Sentry should be enabled.void
setEnableDeduplication
(boolean enableDeduplication) Enables or disables event deduplication.void
setEnableDefaultTagsForMetrics
(boolean enableDefaultTagsForMetrics) void
setEnableExternalConfiguration
(boolean enableExternalConfiguration) Enables loading options from external sources like sentry.properties file or environment variables, system properties.void
setEnableMetrics
(boolean enableMetrics) void
setEnablePrettySerializationOutput
(boolean enablePrettySerializationOutput) Whether to format serialized data, e.g.void
setEnableScopePersistence
(boolean enableScopePersistence) void
setEnableScreenTracking
(boolean enableScreenTracking) void
setEnableShutdownHook
(boolean enableShutdownHook) Enables or disable ShutdownHookIntegration.void
setEnableSpanLocalMetricAggregation
(boolean enableSpanLocalMetricAggregation) void
setEnableSpotlight
(boolean enableSpotlight) void
setEnableTimeToFullDisplayTracing
(boolean enableTimeToFullDisplayTracing) Sets if the time-to-full-display spans should be tracked in navigation transactions.void
setEnableTracing
(@Nullable Boolean enableTracing) Deprecated.We're removing enableTracing in 8.0void
setEnableUncaughtExceptionHandler
(boolean enableUncaughtExceptionHandler) Enable or disable the default UncaughtExceptionHandlerIntegration.void
setEnableUserInteractionBreadcrumbs
(boolean enableUserInteractionBreadcrumbs) void
setEnableUserInteractionTracing
(boolean enableUserInteractionTracing) void
setEnvelopeDiskCache
(@Nullable IEnvelopeCache envelopeDiskCache) Sets the EnvelopeCache interfacevoid
setEnvelopeReader
(@Nullable IEnvelopeReader envelopeReader) void
setEnvironment
(@Nullable String environment) Sets the environmentvoid
setExecutorService
(@NotNull ISentryExecutorService executorService) Sets the SentryExecutorServicevoid
setFlushTimeoutMillis
(long flushTimeoutMillis) Sets the flush timeout in millisvoid
setFullyDisplayedReporter
(@NotNull FullyDisplayedReporter fullyDisplayedReporter) void
setGestureTargetLocators
(@NotNull List<io.sentry.internal.gestures.GestureTargetLocator> locators) Sets the list ofGestureTargetLocator
being used to determine relevantUiElement
for user interactions.void
setIdleTimeout
(@Nullable Long idleTimeout) Sets the idle timeout.void
setIgnoredCheckIns
(@Nullable List<String> ignoredCheckIns) void
setInstrumenter
(@NotNull Instrumenter instrumenter) Sets the instrumenter used for performance instrumentation.void
Sets the Logger interface if null, logger will be NoOpvoid
setMainThreadChecker
(@NotNull IMainThreadChecker mainThreadChecker) void
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
setMaxDepth
(int maxDepth) Set the max depth for when serializing object graphs using reflection.void
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
setMaxTraceFileSize
(long maxTraceFileSize) Sets the max trace file size for each envelope item in bytes.void
setModulesLoader
(@Nullable io.sentry.internal.modules.IModulesLoader modulesLoader) void
setPrintUncaughtStackTrace
(boolean printUncaughtStackTrace) Enable or disable printing exceptions in UncaughtExceptionHandlervoid
setProfilesSampler
(@Nullable SentryOptions.ProfilesSamplerCallback profilesSampler) Sets the callback used to determine if a profile is sampled.void
setProfilesSampleRate
(@Nullable Double profilesSampleRate) Sets the profilesSampleRate.void
setProfilingEnabled
(boolean profilingEnabled) Deprecated.void
setProfilingTracesHz
(int profilingTracesHz) Sets the rate the profiler will sample rates at.void
setProguardUuid
(@Nullable 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 String release) Sets the releasevoid
setReplayController
(@Nullable ReplayController replayController) void
setSampleRate
(Double sampleRate) Sets the sampleRate Can be anything between 0.0 and 1.0 or null (default), to disable it.void
setSdkVersion
(@Nullable SdkVersion sdkVersion) Sets the SdkVersion objectvoid
setSendClientReports
(boolean sendClientReports) Enables / disables sending of client reports.void
setSendDefaultPii
(boolean sendDefaultPii) void
setSendModules
(boolean sendModules) Whether to send modules containing information about versions.void
setSentryClientName
(@Nullable String sentryClientName) Sets the Sentry client namevoid
setSerializer
(@Nullable ISerializer serializer) Sets the Serializer interface if null, Serializer will be NoOpvoid
setServerName
(@Nullable String serverName) Sets the default server name to be used in Sentry events.void
setSessionFlushTimeoutMillis
(long sessionFlushTimeoutMillis) void
setSessionTrackingIntervalMillis
(long sessionTrackingIntervalMillis) Sets the session tracking interval in millisvoid
setShutdownTimeout
(long shutdownTimeoutMillis) Deprecated.void
setShutdownTimeoutMillis
(long shutdownTimeoutMillis) Sets the shutdown timeout in Millis Default is 2000 = 2svoid
setSpotlightConnectionUrl
(@Nullable String spotlightConnectionUrl) void
setSslSocketFactory
(@Nullable SSLSocketFactory sslSocketFactory) Set custom SSLSocketFactory that is trusted to self-signed certificatesvoid
Sets a tag that is applied to all events and transactions.void
setTraceOptionsRequests
(boolean traceOptionsRequests) Whether OPTIONS requests should be traced.void
setTracePropagationTargets
(@Nullable List<String> tracePropagationTargets) void
setTraceSampling
(boolean traceSampling) Deprecated.please use {setTracePropagationTargets(List)
} insteadvoid
setTracesSampler
(@Nullable SentryOptions.TracesSamplerCallback tracesSampler) Sets the callback used to determine if transaction is sampled.void
setTracesSampleRate
(@Nullable Double tracesSampleRate) Sets the tracesSampleRate Can be anything between 0.0 and 1.0 or null (default), to disable it.void
setTracingOrigins
(@Nullable List<String> tracingOrigins) Deprecated.void
setTransactionPerformanceCollector
(@NotNull TransactionPerformanceCollector transactionPerformanceCollector) Sets the performance collector used to collect performance stats while transactions run.void
setTransactionProfiler
(@Nullable ITransactionProfiler transactionProfiler) Sets the listener interface to perform operations when a transaction is started or ended.void
setTransportFactory
(@Nullable ITransportFactory transportFactory) Sets the TransportFactory interfacevoid
setTransportGate
(@Nullable ITransportGate transportGate) Sets the TransportGate interfacevoid
setViewHierarchyExporters
(@NotNull List<io.sentry.internal.viewhierarchy.ViewHierarchyExporter> exporters) Sets the list ofViewHierarchyExporter
being used to export the view hierarchy.
-
Field Details
-
DEFAULT_PROPAGATION_TARGETS
- See Also:
-
-
Constructor Details
-
SentryOptions
public SentryOptions()SentryOptions ctor It adds and set default things
-
-
Method Details
-
addEventProcessor
Adds an event processor- Parameters:
eventProcessor
- the event processor
-
getEventProcessors
Returns the list of event processors- Returns:
- the event processor list
-
addIntegration
Adds an integration- Parameters:
integration
- the integration
-
getIntegrations
Returns the list of integrations- Returns:
- the integration list
-
getDsn
Returns the DSN.- Returns:
- the DSN or null if not set
-
setDsn
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(boolean debug) Sets the debug mode to ON or OFF Default is OFF- Parameters:
debug
- true if ON or false otherwise
-
getLogger
Returns the Logger interface- Returns:
- the logger
-
setLogger
Sets the Logger interface if null, logger will be NoOp- Parameters:
logger
- the logger interface
-
getDiagnosticLevel
Returns the minimum LogLevel- Returns:
- the log level
-
setDiagnosticLevel
Sets the minimum LogLevel if null, it uses the default min. LogLevel Default is DEBUG- Parameters:
diagnosticLevel
- the log level
-
getSerializer
Returns the Serializer interface- Returns:
- the serializer
-
setSerializer
Sets the Serializer interface if null, Serializer will be NoOp- Parameters:
serializer
- the serializer
-
getMaxDepth
public int getMaxDepth()Returns the max depth for when serializing object graphs using reflection.- Returns:
- the max depth
-
setMaxDepth
public void setMaxDepth(int maxDepth) Set the max depth for when serializing object graphs using reflection.- Parameters:
maxDepth
- the max depth
-
getEnvelopeReader
-
setEnvelopeReader
-
getShutdownTimeout
Deprecated.use {getShutdownTimeoutMillis()
}Returns the shutdown timeout in Millis- Returns:
- the timeout in Millis
-
getShutdownTimeoutMillis
public long getShutdownTimeoutMillis()Returns the shutdown timeout in Millis- Returns:
- the timeout in Millis
-
setShutdownTimeout
Deprecated.Sets the shutdown timeout in Millis Default is 2000 = 2s- Parameters:
shutdownTimeoutMillis
- the shutdown timeout in millis
-
setShutdownTimeoutMillis
public void setShutdownTimeoutMillis(long shutdownTimeoutMillis) Sets the shutdown timeout in Millis Default is 2000 = 2s- Parameters:
shutdownTimeoutMillis
- the shutdown timeout in millis
-
getSentryClientName
Returns the Sentry client name- Returns:
- the Sentry client name or null if not set
-
setSentryClientName
Sets the Sentry client name- Parameters:
sentryClientName
- the Sentry client name
-
getBeforeSend
Returns the BeforeSend callback- Returns:
- the beforeSend callback or null if not set
-
setBeforeSend
Sets the beforeSend callback- Parameters:
beforeSend
- the beforeSend callback
-
getBeforeSendTransaction
Returns the BeforeSendTransaction callback- Returns:
- the beforeSendTransaction callback or null if not set
-
setBeforeSendTransaction
public void setBeforeSendTransaction(@Nullable @Nullable SentryOptions.BeforeSendTransactionCallback beforeSendTransaction) Sets the beforeSendTransaction callback- Parameters:
beforeSendTransaction
- the beforeSendTransaction callback
-
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
Returns the cache dir. path if set- Returns:
- the cache dir. path or null if not set
-
getOutboxPath
Returns the outbox path if cacheDirPath is set- Returns:
- the outbox path or null if not set
-
setCacheDirPath
Sets the cache dir. path- Parameters:
cacheDirPath
- the cache dir. path
-
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
Returns the release- Returns:
- the release or null if not set
-
setRelease
Sets the release- Parameters:
release
- the release
-
getEnvironment
Returns the environment- Returns:
- the environment or 'production' if not set
-
setEnvironment
Sets the environment- Parameters:
environment
- the environment
-
getProxy
Returns the proxy if set- Returns:
- the proxy or null if not set
-
setProxy
Sets the proxy- Parameters:
proxy
- the proxy
-
getSampleRate
Returns the sample rate Default is null (disabled)- Returns:
- the sample rate
-
setSampleRate
Sets the sampleRate Can be anything between 0.0 and 1.0 or null (default), to disable it.- Parameters:
sampleRate
- the sample rate
-
getEnableTracing
Deprecated.We're removing enableTracing in 8.0Whether generation of transactions and propagation of trace data is enabled.NOTE: There is also
isTracingEnabled()
which checks other options as well.- Returns:
- true if enabled, false if disabled, null can mean enabled if
getTracesSampleRate()
orgetTracesSampler()
are set.
-
setEnableTracing
Deprecated.We're removing enableTracing in 8.0Enables generation of transactions and propagation of trace data. -
getTracesSampleRate
Returns the traces sample rate Default is null (disabled)- Returns:
- the sample rate
-
setTracesSampleRate
Sets the tracesSampleRate Can be anything between 0.0 and 1.0 or null (default), to disable it.- Parameters:
tracesSampleRate
- the sample rate
-
getTracesSampler
Returns the callback used to determine if transaction is sampled.- Returns:
- the callback
-
setTracesSampler
Sets the callback used to determine if transaction is sampled.- Parameters:
tracesSampler
- the callback
-
getInAppExcludes
the list of inApp excludes- Returns:
- the inApp excludes list
-
addInAppExclude
Adds an inApp exclude- Parameters:
exclude
- the inApp exclude module/package
-
getInAppIncludes
Returns the inApp includes list- Returns:
- the inApp includes list
-
addInAppInclude
Adds an inApp include- Parameters:
include
- the inApp include module/package
-
getTransportFactory
Returns the TransportFactory interface- Returns:
- the transport factory
-
setTransportFactory
Sets the TransportFactory interface- Parameters:
transportFactory
- the transport factory
-
getDist
Sets the distribution- Returns:
- the distribution or null if not set
-
setDist
Sets the distribution- Parameters:
dist
- the distribution
-
getTransportGate
Returns the TransportGate interface- Returns:
- the transport gate
-
setTransportGate
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
-
getServerName
Gets the default server name to be used in Sentry events.- Returns:
- the default server name or null if none set
-
setServerName
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
Returns the distinct Id- Returns:
- the distinct Id
-
setDistinctId
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.
-
setEnableUncaughtExceptionHandler
public void setEnableUncaughtExceptionHandler(boolean enableUncaughtExceptionHandler) Enable or disable the default UncaughtExceptionHandlerIntegration.- Parameters:
enableUncaughtExceptionHandler
- true if enabled or false otherwise.
-
isPrintUncaughtStackTrace
public boolean isPrintUncaughtStackTrace()Checks if printing exceptions by UncaughtExceptionHandler is enabled or disabled.- Returns:
- true if enabled or false otherwise.
-
setPrintUncaughtStackTrace
public void setPrintUncaughtStackTrace(boolean printUncaughtStackTrace) Enable or disable printing exceptions in UncaughtExceptionHandler- Parameters:
printUncaughtStackTrace
- true if enabled or false otherwise.
-
getExecutorService
Returns the SentryExecutorService- Returns:
- the SentryExecutorService
-
setExecutorService
@Internal @TestOnly public void setExecutorService(@NotNull @NotNull ISentryExecutorService executorService) Sets the SentryExecutorService- Parameters:
executorService
- the SentryExecutorService
-
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
Returns the EnvelopeCache interface- Returns:
- the EnvelopeCache object
-
setEnvelopeDiskCache
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
Returns the SdkVersion object- Returns:
- the SdkVersion object or null
-
getSslSocketFactory
Returns SSLSocketFactory- Returns:
- SSLSocketFactory object or null
-
setSslSocketFactory
Set custom SSLSocketFactory that is trusted to self-signed certificates- Parameters:
sslSocketFactory
- SSLSocketFactory object
-
setSdkVersion
Sets the SdkVersion object- Parameters:
sdkVersion
- the SdkVersion object or null
-
isSendDefaultPii
public boolean isSendDefaultPii() -
setSendDefaultPii
public void setSendDefaultPii(boolean sendDefaultPii) -
addScopeObserver
Adds a Scope observer- Parameters:
observer
- the Observer
-
getScopeObservers
Returns the list of Scope observers- Returns:
- the Scope observer list
-
addOptionsObserver
Adds a SentryOptions observer- Parameters:
observer
- the Observer
-
getOptionsObservers
Returns the list of SentryOptions observers- Returns:
- the SentryOptions observer list
-
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
Returns tags applied to all events and transactions.- Returns:
- the tags map
-
setTag
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(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
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
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
-
setMaxRequestBodySize
-
isTraceSampling
@Experimental public boolean isTraceSampling()Returns whether the `baggage` header is attached to HTTP client integrations and the `trace` header is attached to envelopes.Note: this is an experimental API and will be removed without notice.
- Returns:
- true if enabled
-
setTraceSampling
Deprecated.please use {setTracePropagationTargets(List)
} insteadControls if the `baggage` header is attached HTTP client integrations and if the `trace` header is attached to envelopes. Defaults to false.Note: this is an experimental API and will be removed without notice.
- Parameters:
traceSampling
- - if trace sampling should be enabled
-
getMaxTraceFileSize
public long getMaxTraceFileSize()Returns the maximum trace file size for each envelope item in bytes.- Returns:
- the maximum attachment size in bytes.
-
setMaxTraceFileSize
public void setMaxTraceFileSize(long maxTraceFileSize) Sets the max trace file size for each envelope item in bytes. Default is 5 Mb.- Parameters:
maxTraceFileSize
- the max trace file size in bytes.
-
getTransactionProfiler
Returns the listener interface to perform operations when a transaction is started or ended.- Returns:
- the listener interface to perform operations when a transaction is started or ended.
-
setTransactionProfiler
Sets the listener interface to perform operations when a transaction is started or ended. It only has effect if no profiler was already set.- Parameters:
transactionProfiler
- - the listener for operations when a transaction is started or ended
-
isProfilingEnabled
public boolean isProfilingEnabled()Returns if profiling is enabled for transactions.- Returns:
- if profiling is enabled for transactions.
-
setProfilingEnabled
Deprecated.Sets whether profiling is enabled for transactions.- Parameters:
profilingEnabled
- - whether profiling is enabled for transactions
-
getProfilesSampler
Returns the callback used to determine if a profile is sampled.- Returns:
- the callback
-
setProfilesSampler
public void setProfilesSampler(@Nullable @Nullable SentryOptions.ProfilesSamplerCallback profilesSampler) Sets the callback used to determine if a profile is sampled.- Parameters:
profilesSampler
- the callback
-
getProfilesSampleRate
Returns the profiles sample rate. Default is null (disabled).- Returns:
- the sample rate
-
setProfilesSampleRate
Sets the profilesSampleRate. Can be anything between 0.0 and 1.0 or null (default), to disable it. It's dependent on the {setTracesSampleRate(Double)
} If a transaction is sampled, then a profile could be sampled with a probability given by profilesSampleRate.- Parameters:
profilesSampleRate
- the sample rate
-
getProfilingTracesDirPath
Returns the profiling traces dir. path if set- Returns:
- the profiling traces dir. path or null if not set
-
getTracingOrigins
Deprecated.use {getTracePropagationTargets()
}Returns a list of origins to which `sentry-trace` header should be sent in HTTP integrations.- Returns:
- the list of origins
-
addTracingOrigin
Deprecated.Adds an origin to which `sentry-trace` header should be sent in HTTP integrations.- Parameters:
tracingOrigin
- - the tracing origin
-
setTracingOrigins
@Deprecated @Internal public void setTracingOrigins(@Nullable @Nullable List<String> tracingOrigins) Deprecated. -
getTracePropagationTargets
Returns a list of origins to which `sentry-trace` header should be sent in HTTP integrations.- Returns:
- the list of targets
-
setTracePropagationTargets
-
getProguardUuid
Returns a Proguard UUID.- Returns:
- the Proguard UUIDs.
-
setProguardUuid
Sets a Proguard UUID.- Parameters:
proguardUuid
- - the Proguard UUID
-
addBundleId
Adds a bundle ID (also known as debugId) representing a source bundle that contains sources for this application. These sources will be used to source code for frames of an exceptions stack trace.- Parameters:
bundleId
- Bundle ID generated by sentry-cli or the sentry-android-gradle-plugin
-
getBundleIds
Returns all configured bundle IDs referencing source code bundles.- Returns:
- list of bundle IDs
-
getContextTags
Returns Context tags names applied to Sentry events as Sentry tags.- Returns:
- context tags
-
addContextTag
Adds context tag name that is applied to Sentry events as Sentry tag.- Parameters:
contextTag
- - the context tag
-
getIdleTimeout
Returns the idle timeout.- Returns:
- the idle timeout in millis or null.
-
setIdleTimeout
Sets the idle timeout.- Parameters:
idleTimeout
- the idle timeout in millis or null.
-
isSendClientReports
public boolean isSendClientReports()Returns whether sending of client reports has been enabled.- Returns:
- true if enabled; false if disabled
-
setSendClientReports
public void setSendClientReports(boolean sendClientReports) Enables / disables sending of client reports.- Parameters:
sendClientReports
- true enables client reports; false disables them
-
isEnableUserInteractionTracing
public boolean isEnableUserInteractionTracing() -
setEnableUserInteractionTracing
public void setEnableUserInteractionTracing(boolean enableUserInteractionTracing) -
isEnableUserInteractionBreadcrumbs
public boolean isEnableUserInteractionBreadcrumbs() -
setEnableUserInteractionBreadcrumbs
public void setEnableUserInteractionBreadcrumbs(boolean enableUserInteractionBreadcrumbs) -
setInstrumenter
Sets the instrumenter used for performance instrumentation.If you set this to something other than
Instrumenter.SENTRY
Sentry will not create any transactions automatically nor will it create transactions if you call startTransaction(...), nor will it create child spans if you call startChild(...)- Parameters:
instrumenter
- - the instrumenter to use
-
getInstrumenter
Returns the instrumenter used for performance instrumentation- Returns:
- the configured instrumenter
-
getClientReportRecorder
Returns a ClientReportRecorder or a NoOp if sending of client reports has been disabled.- Returns:
- a client report recorder or NoOp
-
getModulesLoader
@Internal @NotNull public @NotNull io.sentry.internal.modules.IModulesLoader getModulesLoader()Returns a ModulesLoader to load external modules (dependencies/packages) of the program.- Returns:
- a modules loader or no-op
-
setModulesLoader
@Internal public void setModulesLoader(@Nullable @Nullable io.sentry.internal.modules.IModulesLoader modulesLoader) -
getDebugMetaLoader
@Internal @NotNull public @NotNull io.sentry.internal.debugmeta.IDebugMetaLoader getDebugMetaLoader()Returns a DebugMetaLoader to load sentry-debug-meta.properties containing ProGuard UUID, source bundle IDs etc.- Returns:
- a loader or no-op
-
setDebugMetaLoader
@Internal public void setDebugMetaLoader(@Nullable @Nullable io.sentry.internal.debugmeta.IDebugMetaLoader debugMetaLoader) -
getGestureTargetLocators
Returns a list of allGestureTargetLocator
instances used to determine whichUiElement
was part of an user interaction.- Returns:
- a list of
GestureTargetLocator
-
setGestureTargetLocators
public void setGestureTargetLocators(@NotNull @NotNull List<io.sentry.internal.gestures.GestureTargetLocator> locators) Sets the list ofGestureTargetLocator
being used to determine relevantUiElement
for user interactions.- Parameters:
locators
- a list ofGestureTargetLocator
-
getViewHierarchyExporters
@NotNull public final @NotNull List<io.sentry.internal.viewhierarchy.ViewHierarchyExporter> getViewHierarchyExporters()Returns a list of allViewHierarchyExporter
instances used to export view hierarchy information.- Returns:
- a list of
ViewHierarchyExporter
-
setViewHierarchyExporters
public void setViewHierarchyExporters(@NotNull @NotNull List<io.sentry.internal.viewhierarchy.ViewHierarchyExporter> exporters) Sets the list ofViewHierarchyExporter
being used to export the view hierarchy.- Parameters:
exporters
- a list ofViewHierarchyExporter
-
getMainThreadChecker
-
setMainThreadChecker
-
getTransactionPerformanceCollector
@Internal @NotNull public @NotNull TransactionPerformanceCollector getTransactionPerformanceCollector()Gets the performance collector used to collect performance stats while transactions run.- Returns:
- the performance collector.
-
setTransactionPerformanceCollector
@Internal public void setTransactionPerformanceCollector(@NotNull @NotNull TransactionPerformanceCollector transactionPerformanceCollector) Sets the performance collector used to collect performance stats while transactions run.- Parameters:
transactionPerformanceCollector
- the performance collector.
-
isEnableTimeToFullDisplayTracing
public boolean isEnableTimeToFullDisplayTracing()Gets if the time-to-full-display spans is tracked in navigation transactions.- Returns:
- if the time-to-full-display is tracked.
-
setEnableTimeToFullDisplayTracing
public void setEnableTimeToFullDisplayTracing(boolean enableTimeToFullDisplayTracing) Sets if the time-to-full-display spans should be tracked in navigation transactions.- Parameters:
enableTimeToFullDisplayTracing
- if the time-to-full-display spans should be tracked.
-
getFullyDisplayedReporter
Gets the reporter to call when a screen is fully loaded, used for time-to-full-display spans.- Returns:
- The reporter to call when a screen is fully loaded.
-
setFullyDisplayedReporter
@Internal @TestOnly public void setFullyDisplayedReporter(@NotNull @NotNull FullyDisplayedReporter fullyDisplayedReporter) -
isTraceOptionsRequests
public boolean isTraceOptionsRequests()Whether OPTIONS requests should be traced.- Returns:
- true if OPTIONS requests should be traced
-
setTraceOptionsRequests
public void setTraceOptionsRequests(boolean traceOptionsRequests) Whether OPTIONS requests should be traced.- Parameters:
traceOptionsRequests
- true if OPTIONS requests should be traced
-
isEnabled
public boolean isEnabled()Whether Sentry is enabled.- Returns:
- true if Sentry should be enabled
-
setEnabled
public void setEnabled(boolean enabled) Whether Sentry should be enabled.- Parameters:
enabled
- true if Sentry should be enabled
-
isEnablePrettySerializationOutput
public boolean isEnablePrettySerializationOutput()Whether to format serialized data, e.g. events logged to console in debug mode- Returns:
- true if data should be pretty printed
-
isSendModules
public boolean isSendModules()Whether to send modules containing information about versions.- Returns:
- true if modules should be sent.
-
setEnablePrettySerializationOutput
public void setEnablePrettySerializationOutput(boolean enablePrettySerializationOutput) Whether to format serialized data, e.g. events logged to console in debug mode- Parameters:
enablePrettySerializationOutput
- true if output should be pretty printed
-
isEnableAppStartProfiling
public boolean isEnableAppStartProfiling()Whether to profile app launches, depending on profilesSampler or profilesSampleRate. Depends onisProfilingEnabled()
- Returns:
- true if app launches should be profiled.
-
setEnableAppStartProfiling
public void setEnableAppStartProfiling(boolean enableAppStartProfiling) Whether to profile app launches, depending on profilesSampler or profilesSampleRate.- Parameters:
enableAppStartProfiling
- true if app launches should be profiled.
-
setSendModules
public void setSendModules(boolean sendModules) Whether to send modules containing information about versions.- Parameters:
sendModules
- true if modules should be sent.
-
setIgnoredCheckIns
-
getIgnoredCheckIns
-
getDateProvider
Returns the currentSentryDateProvider
that is used to retrieve the current date. -
setDateProvider
Sets theSentryDateProvider
which is used to retrieve the current date.Different providers offer different precision. By default Sentry tries to offer the highest precision available for the system.
-
addPerformanceCollector
Adds a ICollector.- Parameters:
collector
- the ICollector.
-
getPerformanceCollectors
Returns the list of ICollectors.- Returns:
- the IPerformanceCollector list.
-
getConnectionStatusProvider
-
setConnectionStatusProvider
public void setConnectionStatusProvider(@NotNull @NotNull IConnectionStatusProvider connectionStatusProvider) -
getBackpressureMonitor
-
setBackpressureMonitor
@Internal public void setBackpressureMonitor(@NotNull @NotNull IBackpressureMonitor backpressureMonitor) -
setEnableBackpressureHandling
@Experimental public void setEnableBackpressureHandling(boolean enableBackpressureHandling) -
getProfilingTracesHz
@Internal public int getProfilingTracesHz()Returns the rate the profiler will sample rates at. 100 hz means 100 traces in 1 second.- Returns:
- Rate the profiler will sample rates at.
-
setProfilingTracesHz
@Internal public void setProfilingTracesHz(int profilingTracesHz) Sets the rate the profiler will sample rates at. 100 hz means 100 traces in 1 second. -
isEnableBackpressureHandling
@Experimental public boolean isEnableBackpressureHandling() -
getSessionFlushTimeoutMillis
@Internal public long getSessionFlushTimeoutMillis() -
setSessionFlushTimeoutMillis
@Internal public void setSessionFlushTimeoutMillis(long sessionFlushTimeoutMillis) -
getBeforeEnvelopeCallback
@Internal @Nullable public @Nullable SentryOptions.BeforeEnvelopeCallback getBeforeEnvelopeCallback() -
setBeforeEnvelopeCallback
@Internal public void setBeforeEnvelopeCallback(@Nullable @Nullable SentryOptions.BeforeEnvelopeCallback beforeEnvelopeCallback) -
getSpotlightConnectionUrl
-
setSpotlightConnectionUrl
@Experimental public void setSpotlightConnectionUrl(@Nullable @Nullable String spotlightConnectionUrl) -
isEnableSpotlight
@Experimental public boolean isEnableSpotlight() -
setEnableSpotlight
@Experimental public void setEnableSpotlight(boolean enableSpotlight) -
isEnableScopePersistence
public boolean isEnableScopePersistence() -
setEnableScopePersistence
public void setEnableScopePersistence(boolean enableScopePersistence) -
isEnableMetrics
@Experimental public boolean isEnableMetrics() -
setEnableMetrics
@Experimental public void setEnableMetrics(boolean enableMetrics) -
isEnableSpanLocalMetricAggregation
@Experimental public boolean isEnableSpanLocalMetricAggregation() -
setEnableSpanLocalMetricAggregation
@Experimental public void setEnableSpanLocalMetricAggregation(boolean enableSpanLocalMetricAggregation) -
isEnableDefaultTagsForMetrics
@Experimental public boolean isEnableDefaultTagsForMetrics() -
setEnableDefaultTagsForMetrics
@Experimental public void setEnableDefaultTagsForMetrics(boolean enableDefaultTagsForMetrics) -
getBeforeEmitMetricCallback
@Experimental @Nullable public @Nullable SentryOptions.BeforeEmitMetricCallback getBeforeEmitMetricCallback() -
setBeforeEmitMetricCallback
@Experimental public void setBeforeEmitMetricCallback(@Nullable @Nullable SentryOptions.BeforeEmitMetricCallback beforeEmitMetricCallback) -
getCron
-
setCron
-
getExperimental
-
getReplayController
-
setReplayController
-
isEnableScreenTracking
@Experimental public boolean isEnableScreenTracking() -
setEnableScreenTracking
@Experimental public void setEnableScreenTracking(boolean enableScreenTracking) -
empty
Creates SentryOptions instance without initializing any of the internal parts.Used by
NoOpHub
.- Returns:
- SentryOptions
-
merge
Merges with anotherSentryOptions
object. Used when loading additional options from external locations.- Parameters:
options
- options loaded from external locations
-
setTracePropagationTargets(List)
}