Protected Optional Readonly_The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled.
Protected_Protected_Protected_Array of set up integrations.
Protected_Number of calls being processed
Protected Readonly_Options passed to the SDK.
Protected_Holds flushable
Protected_Protected Optional Readonly_Protected_Protected_Clears outcomes on this client and returns them.
Protected_Sends client reports as an envelope.
Protected_Custom implementation for OTEL, so we can handle scope-span linking.
Protected_Determine if the client is finished processing. Returns a promise because it will wait timeout ms before saying
"no" (resolving to false) in order to give the client a chance to potentially finish first.
Optionaltimeout: numberThe time, in ms, after which to resolve to false if the client is still busy. Passing 0 (or not
passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
true.
A promise which will resolve to true if processing is already done or finishes before the timeout, and
false otherwise
Protected_Determines whether this SDK is enabled and a transport is present.
Protected_Protected_Occupies the client with processing and event
Protected_Processes an event (either error or message) and sends it to Sentry.
This also adds breadcrumbs and context information to the event. However, platform specific meta data (such as the User's IP address) must be added by the SDK implementor.
A SyncPromise that resolves with the event or rejects in case event was/will not be send.
Protected_Protected_Adds an event processor that applies to any event processed by this client.
Add an integration to the client.
This can be used to e.g. lazy load integrations.
In most cases, this should not be necessary,
and you're better off just passing the integrations via integrations: [] at initialization time.
However, if you find the need to conditionally load & add an integration, you can use addIntegration to do so.
Create a cron monitor check in and send it to Sentry.
An object that describes a check in.
OptionalmonitorConfig: MonitorConfigOptionalscope: ScopeCaptures a message event and sends it to Sentry.
Unlike captureMessage exported from every SDK, this method requires that you pass it the current scope.
Optionallevel: SeverityLevelOptionalhint: EventHintOptionalcurrentScope: ScopeDisposes of the client and releases all resources.
This method clears all internal state to allow the client to be garbage collected. It clears hooks, event processors, integrations, transport, and other internal references.
Call this method after flushing to allow the client to be garbage collected. After calling dispose(), the client should not be used anymore.
Subclasses should override this method to clean up their own resources and call super.dispose().
A hook that is called every time before a span is sampled.
Fire a hook indicating that an idle span is allowed to auto finish.
Fire a hook event for envelope creation and sending. Expects to be given an envelope as the second argument.
Fire a hook indicating that stack frame metadata should be applied to the event passed to the hook.
Fire a hook event before sending a session/aggregates. Expects to be given the prepared session/aggregates as second argument.
Fire a hook event after sending an event. Expects to be given an Event as the second argument.
Fire a hook for when a breadcrumb is added. Expects the breadcrumb as second argument.
Optionalhint: BreadcrumbHintFire a hook for when a DSC (Dynamic Sampling Context) is created. Expects the DSC as second argument.
OptionalrootSpan: SpanFire a hook event for after preparing a feedback event. Events to be given a feedback event as the second argument, and an optional options object as third argument.
Optionaloptions: { includeReplay?: boolean }Fire a hook event for when the feedback widget is opened in a user's browser
Emit a hook event for browser tracing integrations to trigger a span start for a page load.
OptionaltraceOptions: { baggage?: string; sentryTrace?: string }Emit a hook event for browser tracing integrations to trigger the end of a page load span.
Emit a hook event for browser tracing integrations to trigger aafter the pageload span was started.
Emit a hook event for triggering right before a navigation span is started.
OptionalnavigationOptions: { isRedirect?: boolean }Emit a hook event for browser tracing integrations to trigger a span for a navigation.
OptionalnavigationOptions: { isRedirect?: boolean }Emit a hook event for GraphQL client integration to enhance a span with request data.
Emit a hook event for GraphQL client integration to enhance a breadcrumb with request data.
Emit a hook event for client flush
Emit a hook event for client close
Emit a hook event for client before capturing a log. This hooks runs before beforeSendLog is fired.
Emit a hook event for client after capturing a log.
Emit a hook event for client flush logs
Emit a hook event for client after capturing a metric.
Emit a hook event for client flush metrics
Emit a hook event for client to process a metric before it is captured.
This hook is called before the beforeSendMetric callback is fired.
Emit a hook event for client when a http server request is started. This hook is called after request isolation, but before the request is processed.
Emit a hook event for starting the UI Profiler.
Emit a hook event for stopping the UI Profiler.
Optionallevel: SeverityLevelOptionalhint: EventHintGet the current Dsn.
Get all installed event processors.
Gets an installed integration by its name.
The installed integration or undefined if no integration with that name was installed.
Get the current options.
Returns the transport that is used by the client. Please note that the transport gets lazy initialized so it will only be there once the first event has been sent.
Initialize this client. Call this after the client was set on a scope.
Register a callback for whenever a span is started. Receives the span as argument.
A function that, when executed, removes the registered callback.
Register a callback before span sampling runs. Receives a samplingDecision object argument with a decision
property that can be used to make a sampling decision that will be enforced, before any span sampling runs.
A function that, when executed, removes the registered callback.
Register a callback for after a span is ended. NOTE: The span cannot be mutated anymore in this callback. Receives the span as argument.
A function that, when executed, removes the registered callback.
Register a callback for when an idle span is allowed to auto-finish.
A function that, when executed, removes the registered callback.
Register a callback for transaction start and finish.
A function that, when executed, removes the registered callback.
Register a callback that runs when stack frame metadata should be applied to an event.
A function that, when executed, removes the registered callback.
Register a callback for before sending an event. This is called right before an event is sent and should not be used to mutate the event. Receives an Event & EventHint as arguments.
A function that, when executed, removes the registered callback.
Register a callback for before sending a session or session aggregrates.. Receives the session/aggregate as second argument.
A function that, when executed, removes the registered callback.
Register a callback for preprocessing an event, before it is passed to (global) event processors. Receives an Event & EventHint as arguments.
A function that, when executed, removes the registered callback.
Register a callback for postprocessing an event, after it was passed to (global) event processors, before it is being sent. Receives an Event & EventHint as arguments.
A function that, when executed, removes the registered callback.
Register a callback for when an event has been sent.
A function that, when executed, removes the registered callback.
Register a callback before a breadcrumb is added.
A function that, when executed, removes the registered callback.
Register a callback when a DSC (Dynamic Sampling Context) is created.
A function that, when executed, removes the registered callback.
Register a callback when a Feedback event has been prepared. This should be used to mutate the event. The options argument can hint about what kind of mutation it expects.
A function that, when executed, removes the registered callback.
Register a callback when the feedback widget is opened in a user's browser
A hook for the browser tracing integrations to trigger a span start for a page load.
A function that, when executed, removes the registered callback.
A hook for the browser tracing integrations to trigger the end of a page load span.
A function that, when executed, removes the registered callback.
A hook for the browser tracing integrations to trigger after the pageload span was started.
A function that, when executed, removes the registered callback.
A hook for triggering right before a navigation span is started.
A function that, when executed, removes the registered callback.
A hook for browser tracing integrations to trigger a span for a navigation.
A function that, when executed, removes the registered callback.
A hook for GraphQL client integration to enhance a span with request data.
A function that, when executed, removes the registered callback.
A hook for GraphQL client integration to enhance a breadcrumb with request data.
A function that, when executed, removes the registered callback.
A hook that is called when the client is flushing
A function that, when executed, removes the registered callback.
A hook that is called when the client is closing
A function that, when executed, removes the registered callback.
A hook that is called before a log is captured. This hooks runs before beforeSendLog is fired.
A function that, when executed, removes the registered callback.
A hook that is called after a log is captured
A function that, when executed, removes the registered callback.
A hook that is called when the client is flushing logs
A function that, when executed, removes the registered callback.
A hook that is called after capturing a metric. This hooks runs after beforeSendMetric is fired.
A function that, when executed, removes the registered callback.
A hook that is called when the client is flushing metrics
A function that, when executed, removes the registered callback.
A hook that is called when a metric is processed before it is captured and before the beforeSendMetric callback is fired.
A function that, when executed, removes the registered callback.
A hook that is called when a http server request is started. This hook is called after request isolation, but before the request is processed.
A function that, when executed, removes the registered callback.
A hook that is called when the UI Profiler should start profiling.
This hook is called when running Sentry.uiProfiler.startProfiler().
A function that, when executed, removes the registered callback.
A hook that is called when the UI Profiler should stop profiling.
This hook is called when running Sentry.uiProfiler.stopProfiler().
A function that, when executed, removes the registered callback.
Record on the client that an event got dropped (ie, an event that will not be sent to Sentry).
Optionalcount: numberSend an envelope to Sentry.
Send a session or session aggregrates to Sentry.
Will start tracking client reports for this client.
NOTICE: This method will create an interval that is periodically called and attach a process.on('beforeExit')
hook. To clean up these resources, call .close() when you no longer intend to use the client. Not doing so will
result in a memory leak.
A client for using Sentry with Node & OpenTelemetry.