Package io.sentry
Class SentryClient
java.lang.Object
io.sentry.SentryClient
- All Implemented Interfaces:
ISentryClient
,IMetricsClient
-
Method Summary
Modifier and TypeMethodDescription@NotNull SentryId
captureCheckIn
(@NotNull CheckIn checkIn, @Nullable IScope scope, @Nullable Hint hint) @NotNull SentryId
captureEnvelope
(@NotNull SentryEnvelope envelope, @Nullable Hint hint) Captures an envelope.@NotNull SentryId
captureEvent
(@NotNull SentryEvent event, @Nullable IScope scope, @Nullable Hint hint) Capture the event@NotNull SentryId
captureMetrics
(@NotNull EncodedMetrics metrics) Captures one or more metrics to be sent to Sentry.@NotNull SentryId
captureReplayEvent
(@NotNull SentryReplayEvent event, @Nullable IScope scope, @Nullable Hint hint) void
captureSession
(@NotNull Session session, @Nullable Hint hint) Captures a session.@NotNull SentryId
captureTransaction
(@NotNull SentryTransaction transaction, @Nullable TraceContext traceContext, @Nullable IScope scope, @Nullable Hint hint, @Nullable ProfilingTraceData profilingTraceData) Captures a transaction.void
captureUserFeedback
(@NotNull UserFeedback userFeedback) Captures a manually created user feedback and sends it to Sentry.void
close()
Flushes out the queue for up to timeout seconds and disable the client.void
close
(boolean isRestarting) Flushes out the queue for up to timeout seconds and disable the client.void
flush
(long timeoutMillis) Flushes events queued up, but keeps the client enabled.@NotNull IMetricsAggregator
@Nullable RateLimiter
boolean
Whether the client is enabled or notboolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sentry.ISentryClient
captureEnvelope, captureEvent, captureEvent, captureEvent, captureException, captureException, captureException, captureException, captureMessage, captureMessage, captureSession, captureTransaction, captureTransaction, captureTransaction, captureTransaction
-
Method Details
-
isEnabled
public boolean isEnabled()Description copied from interface:ISentryClient
Whether the client is enabled or not- Specified by:
isEnabled
in interfaceISentryClient
- Returns:
- true if its enabled or false otherwise.
-
captureEvent
@NotNull public @NotNull SentryId captureEvent(@NotNull @NotNull SentryEvent event, @Nullable @Nullable IScope scope, @Nullable @Nullable Hint hint) Description copied from interface:ISentryClient
Capture the event- Specified by:
captureEvent
in interfaceISentryClient
- Parameters:
event
- the eventscope
- An optional scope to be applied to the event.hint
- SDK specific but provides high level information about the origin of the event.- Returns:
- The Id (SentryId object) of the event.
-
captureReplayEvent
@NotNull public @NotNull SentryId captureReplayEvent(@NotNull @NotNull SentryReplayEvent event, @Nullable @Nullable IScope scope, @Nullable @Nullable Hint hint) - Specified by:
captureReplayEvent
in interfaceISentryClient
-
captureUserFeedback
Description copied from interface:ISentryClient
Captures a manually created user feedback and sends it to Sentry.- Specified by:
captureUserFeedback
in interfaceISentryClient
- Parameters:
userFeedback
- The user feedback to send to Sentry.
-
captureSession
@Internal public void captureSession(@NotNull @NotNull Session session, @Nullable @Nullable Hint hint) Description copied from interface:ISentryClient
Captures a session. This method transform a session to an envelope and forwards to captureEnvelope- Specified by:
captureSession
in interfaceISentryClient
- Parameters:
session
- the Sessionhint
- SDK specific but provides high level information about the origin of the event
-
captureEnvelope
@Internal @NotNull public @NotNull SentryId captureEnvelope(@NotNull @NotNull SentryEnvelope envelope, @Nullable @Nullable Hint hint) Description copied from interface:ISentryClient
Captures an envelope.- Specified by:
captureEnvelope
in interfaceISentryClient
- Parameters:
envelope
- the SentryEnvelope to send.hint
- SDK specific but provides high level information about the origin of the event- Returns:
- The Id (SentryId object) of the event
-
captureTransaction
@NotNull public @NotNull SentryId captureTransaction(@NotNull @NotNull SentryTransaction transaction, @Nullable @Nullable TraceContext traceContext, @Nullable @Nullable IScope scope, @Nullable @Nullable Hint hint, @Nullable @Nullable ProfilingTraceData profilingTraceData) Description copied from interface:ISentryClient
Captures a transaction.- Specified by:
captureTransaction
in interfaceISentryClient
- Parameters:
transaction
- theITransaction
to sendtraceContext
- the trace contextscope
- An optional scope to be applied to the event.hint
- SDK specific but provides high level information about the origin of the eventprofilingTraceData
- An optional profiling trace data captured during the transaction- Returns:
- The Id (SentryId object) of the event
-
captureCheckIn
@Experimental @NotNull public @NotNull SentryId captureCheckIn(@NotNull @NotNull CheckIn checkIn, @Nullable @Nullable IScope scope, @Nullable @Nullable Hint hint) - Specified by:
captureCheckIn
in interfaceISentryClient
-
close
public void close()Description copied from interface:ISentryClient
Flushes out the queue for up to timeout seconds and disable the client.- Specified by:
close
in interfaceISentryClient
-
close
public void close(boolean isRestarting) Description copied from interface:ISentryClient
Flushes out the queue for up to timeout seconds and disable the client.- Specified by:
close
in interfaceISentryClient
- Parameters:
isRestarting
- if true, avoids locking the main thread when finishing the queue.
-
flush
public void flush(long timeoutMillis) Description copied from interface:ISentryClient
Flushes events queued up, but keeps the client enabled. Not implemented yet.- Specified by:
flush
in interfaceISentryClient
- Parameters:
timeoutMillis
- time in milliseconds
-
getRateLimiter
- Specified by:
getRateLimiter
in interfaceISentryClient
-
isHealthy
public boolean isHealthy()- Specified by:
isHealthy
in interfaceISentryClient
-
getMetricsAggregator
- Specified by:
getMetricsAggregator
in interfaceISentryClient
-
captureMetrics
Description copied from interface:IMetricsClient
Captures one or more metrics to be sent to Sentry.- Specified by:
captureMetrics
in interfaceIMetricsClient
-