@sentry/core
- Version 8.33.1
- Published
- 1.94 MB
- 2 dependencies
- MIT license
Install
npm i @sentry/core
yarn add @sentry/core
pnpm add @sentry/core
Overview
Base implementation for all Sentry JavaScript SDKs
Index
Variables
- DEFAULT_ENVIRONMENT
- getCurrentHub
- metrics
- metricsDefault
- profiler
- Scope
- SEMANTIC_ATTRIBUTE_CACHE_HIT
- SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE
- SEMANTIC_ATTRIBUTE_CACHE_KEY
- SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME
- SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD
- SEMANTIC_ATTRIBUTE_PROFILE_ID
- SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON
- SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT
- SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE
- SEMANTIC_ATTRIBUTE_SENTRY_OP
- SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN
- SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE
- SEMANTIC_ATTRIBUTE_SENTRY_SOURCE
- SEMANTIC_ATTRIBUTE_URL_FULL
- SPAN_STATUS_ERROR
- SPAN_STATUS_OK
- SPAN_STATUS_UNSET
- TRACING_DEFAULTS
Functions
- addBreadcrumb()
- addChildSpanToSpan()
- addEventProcessor()
- addIntegration()
- addTracingExtensions()
- addTracingHeadersToFetchRequest()
- applyScopeDataToEvent()
- applySdkMetadata()
- captureCheckIn()
- captureConsoleIntegration()
- captureEvent()
- captureException()
- captureFeedback()
- captureMessage()
- captureSession()
- close()
- closeSession()
- continueTrace()
- createCheckInEnvelope()
- createEventEnvelope()
- createSessionEnvelope()
- createSpanEnvelope()
- createTransport()
- debugIntegration()
- dedupeIntegration()
- defineIntegration()
- endSession()
- extraErrorDataIntegration()
- flush()
- functionToStringIntegration()
- getActiveSpan()
- getCapturedScopesOnSpan()
- getClient()
- getCurrentHubShim()
- getCurrentScope()
- getDefaultCurrentScope()
- getDefaultIsolationScope()
- getDynamicSamplingContextFromClient()
- getDynamicSamplingContextFromSpan()
- getEnvelopeEndpointWithUrlEncodedAuth()
- getGlobalScope()
- getIntegrationsToSetup()
- getIsolationScope()
- getMainCarrier()
- getMetricSummaryJsonForSpan()
- getReportDialogEndpoint()
- getRootSpan()
- getSpanDescendants()
- getSpanStatusFromHttpCode()
- getStatusMessage()
- getTraceData()
- getTraceMetaTags()
- handleCallbackErrors()
- hasTracingEnabled()
- inboundFiltersIntegration()
- initAndBind()
- instrumentFetchRequest()
- isEnabled()
- isInitialized()
- isSentryRequestUrl()
- lastEventId()
- linkedErrorsIntegration()
- logSpanEnd()
- logSpanStart()
- makeMultiplexedTransport()
- makeOfflineTransport()
- makeSession()
- mergeScopeData()
- moduleMetadataIntegration()
- notifyEventProcessors()
- parameterize()
- parseSampleRate()
- prepareEvent()
- registerSpanErrorInstrumentation()
- requestDataIntegration()
- rewriteFramesIntegration()
- sampleSpan()
- sessionTimingIntegration()
- setAsyncContextStrategy()
- setCapturedScopesOnSpan()
- setContext()
- setCurrentClient()
- setExtra()
- setExtras()
- setHttpStatus()
- setMeasurement()
- setTag()
- setTags()
- setUser()
- spanIsSampled()
- spanTimeInputToSeconds()
- spanToBaggageHeader()
- spanToJSON()
- spanToTraceContext()
- spanToTraceHeader()
- startIdleSpan()
- startInactiveSpan()
- startNewTrace()
- startSession()
- startSpan()
- startSpanManual()
- suppressTracing()
- thirdPartyErrorFilterIntegration()
- timedEventsToMeasurements()
- trpcMiddleware()
- updateSession()
- withActiveSpan()
- withIsolationScope()
- withMonitor()
- withScope()
- zodErrorsIntegration()
Classes
BaseClient
- addEventProcessor()
- addIntegration()
- captureEvent()
- captureException()
- captureMessage()
- captureSession()
- close()
- emit()
- eventFromException()
- eventFromMessage()
- flush()
- getDsn()
- getEventProcessors()
- getIntegrationByName()
- getOptions()
- getSdkMetadata()
- getTransport()
- init()
- on()
- recordDroppedEvent()
- sendEnvelope()
- sendEvent()
- sendSession()
Interfaces
Type Aliases
Variables
variable DEFAULT_ENVIRONMENT
const DEFAULT_ENVIRONMENT: string;
variable getCurrentHub
const getCurrentHub: () => Hub;
Returns the default hub instance.
If a hub is already registered in the global carrier but this module contains a more recent version, it replaces the registered version. Otherwise, the currently registered hub will be returned.
Deprecated
Use the respective replacement method directly instead.
variable metrics
const metrics: { increment: typeof increment; distribution: typeof distribution; set: typeof set; gauge: typeof gauge; timing: typeof timing; getMetricsAggregatorForClient: typeof getMetricsAggregatorForClient;};
variable metricsDefault
const metricsDefault: any;
variable profiler
const profiler: Profiler;
variable Scope
const Scope: typeof ScopeClass;
Holds additional event information.
variable SEMANTIC_ATTRIBUTE_CACHE_HIT
const SEMANTIC_ATTRIBUTE_CACHE_HIT: string;
variable SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE
const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE: string;
variable SEMANTIC_ATTRIBUTE_CACHE_KEY
const SEMANTIC_ATTRIBUTE_CACHE_KEY: string;
variable SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME
const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME: string;
variable SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD
const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD: string;
TODO: Remove these once we update to latest semantic conventions
variable SEMANTIC_ATTRIBUTE_PROFILE_ID
const SEMANTIC_ATTRIBUTE_PROFILE_ID: string;
The id of the profile that this span occured in.
variable SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON
const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON: string;
The reason why an idle span finished.
variable SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT
const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT: string;
The unit of a measurement, which may be stored as a TimedEvent.
variable SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE
const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE: string;
The value of a measurement, which may be stored as a TimedEvent.
variable SEMANTIC_ATTRIBUTE_SENTRY_OP
const SEMANTIC_ATTRIBUTE_SENTRY_OP: string;
Use this attribute to represent the operation of a span.
variable SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN
const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN: string;
Use this attribute to represent the origin of a span.
variable SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE
const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE: string;
Use this attribute to represent the sample rate used for a span.
variable SEMANTIC_ATTRIBUTE_SENTRY_SOURCE
const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE: string;
Use this attribute to represent the source of a span. Should be one of: custom, url, route, view, component, task, unknown
variable SEMANTIC_ATTRIBUTE_URL_FULL
const SEMANTIC_ATTRIBUTE_URL_FULL: string;
variable SPAN_STATUS_ERROR
const SPAN_STATUS_ERROR: number;
variable SPAN_STATUS_OK
const SPAN_STATUS_OK: number;
variable SPAN_STATUS_UNSET
const SPAN_STATUS_UNSET: number;
variable TRACING_DEFAULTS
const TRACING_DEFAULTS: { idleTimeout: number; finalTimeout: number; childSpanTimeout: number;};
Functions
function addBreadcrumb
addBreadcrumb: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void;
Records a new breadcrumb which will be attached to future events.
Breadcrumbs will be added to subsequent events to provide more context on user's actions prior to an error or crash.
function addChildSpanToSpan
addChildSpanToSpan: (span: SpanWithPotentialChildren, childSpan: Span) => void;
Adds an opaque child span reference to a span.
function addEventProcessor
addEventProcessor: (callback: EventProcessor) => void;
Add an event processor. This will be added to the current isolation scope, ensuring any event that is processed in the current execution context will have the processor applied.
function addIntegration
addIntegration: (integration: Integration) => void;
Add an integration to the current scope's client.
function addTracingExtensions
addTracingExtensions: () => void;
Deprecated
Use
registerSpanErrorInstrumentation()
instead. In v9, this function will be removed. Note that you don't need to call this in Node-based SDKs or when usingbrowserTracingIntegration
.
function addTracingHeadersToFetchRequest
addTracingHeadersToFetchRequest: ( request: string | unknown, client: Client, scope: Scope, options: { headers?: PolymorphicRequestHeaders | { [key: string]: string | string[] }; }, span?: Span) => PolymorphicRequestHeaders | undefined;
Adds sentry-trace and baggage headers to the various forms of fetch headers
function applyScopeDataToEvent
applyScopeDataToEvent: (event: Event, data: ScopeData) => void;
Applies data from the scope to the event and runs all event processors on it.
function applySdkMetadata
applySdkMetadata: ( options: Options, name: string, names?: string[], source?: string) => void;
A builder for the SDK metadata in the options for the SDK initialization.
Note: This function is identical to
buildMetadata
in Remix and NextJS and SvelteKit. We don't extract it for bundle size reasons.Parameter options
SDK options object that gets mutated
Parameter names
list of package names
See Also
https://github.com/getsentry/sentry-javascript/pull/7404
https://github.com/getsentry/sentry-javascript/pull/4196
If you make changes to this function consider updating the others as well.
function captureCheckIn
captureCheckIn: ( checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig) => string;
Create a cron monitor check in and send it to Sentry.
Parameter checkIn
An object that describes a check in.
Parameter upsertMonitorConfig
An optional object that describes a monitor config. Use this if you want to create a monitor automatically when sending a check in.
function captureConsoleIntegration
captureConsoleIntegration: (options?: CaptureConsoleOptions | undefined) => any;
Send Console API calls as Sentry Events.
function captureEvent
captureEvent: (event: Event, hint?: EventHint) => string;
Captures a manually created event and sends it to Sentry.
Parameter event
The event to send to Sentry.
Parameter hint
Optional additional data to attach to the Sentry event.
Returns
the id of the captured event.
function captureException
captureException: ( exception: any, hint?: ExclusiveEventHintOrCaptureContext) => string;
Captures an exception event and sends it to Sentry.
Parameter exception
The exception to capture.
Parameter hint
Optional additional data to attach to the Sentry event.
Returns
the id of the captured Sentry event.
function captureFeedback
captureFeedback: ( params: SendFeedbackParams, hint?: EventHint & { includeReplay?: boolean }, scope?: any) => string;
Send user feedback to Sentry.
function captureMessage
captureMessage: ( message: string, captureContext?: CaptureContext | SeverityLevel) => string;
Captures a message event and sends it to Sentry.
Parameter message
The message to send to Sentry.
Parameter captureContext
Define the level of the message or pass in additional data to attach to the message.
Returns
the id of the captured message.
function captureSession
captureSession: (end?: boolean) => void;
Sends the current session on the scope to Sentry
Parameter end
If set the session will be marked as exited and removed from the scope. Defaults to
false
.
function close
close: (timeout?: number) => Promise<boolean>;
Call
close()
on the current client, if there is one. See Client.close.Parameter timeout
Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this parameter will cause the client to wait until all events are sent before disabling itself.
Returns
A promise which resolves to
true
if the queue successfully drains before the timeout, orfalse
if it doesn't (or if there's no client defined).
function closeSession
closeSession: (session: Session, status?: Exclude<SessionStatus, 'ok'>) => void;
Closes a session by setting its status and updating the session object with it. Internally calls
updateSession
to update the passed session object.Note that this function mutates the passed session (@see updateSession for explanation).
Parameter session
the
Session
object to be closedParameter status
the
SessionStatus
with which the session was closed. If you don't pass a status, this function will keep the previously set status, unless it was'ok'
in which case it is changed to'exited'
.
function continueTrace
continueTrace: <V>( { sentryTrace, baggage, }: { sentryTrace: Parameters<typeof propagationContextFromHeaders>[0]; baggage: Parameters<typeof propagationContextFromHeaders>[1]; }, callback: () => V) => V;
Continue a trace from
sentry-trace
andbaggage
values. These values can be obtained from incoming request headers, or in the browser from<meta name="sentry-trace">
and<meta name="baggage">
HTML tags.Spans started with
startSpan
,startSpanManual
andstartInactiveSpan
, within the callback will automatically be attached to the incoming trace.
function createCheckInEnvelope
createCheckInEnvelope: ( checkIn: SerializedCheckIn, dynamicSamplingContext?: DynamicSamplingContext, metadata?: SdkMetadata, tunnel?: string, dsn?: DsnComponents) => CheckInEnvelope;
Create envelope from check in item.
function createEventEnvelope
createEventEnvelope: ( event: Event, dsn?: DsnComponents, metadata?: SdkMetadata, tunnel?: string) => EventEnvelope;
Create an Envelope from an event.
function createSessionEnvelope
createSessionEnvelope: ( session: Session | SessionAggregates, dsn?: DsnComponents, metadata?: SdkMetadata, tunnel?: string) => SessionEnvelope;
Creates an envelope from a Session
function createSpanEnvelope
createSpanEnvelope: ( spans: [SentrySpan, ...SentrySpan[]], client?: Client) => SpanEnvelope;
Create envelope from Span item.
Takes an optional client and runs spans through
beforeSendSpan
if available.
function createTransport
createTransport: ( options: InternalBaseTransportOptions, makeRequest: TransportRequestExecutor, buffer?: PromiseBuffer<TransportMakeRequestResponse>) => Transport;
Creates an instance of a Sentry
Transport
Parameter options
Parameter makeRequest
function debugIntegration
debugIntegration: (options?: DebugOptions | undefined) => any;
function dedupeIntegration
dedupeIntegration: () => any;
Deduplication filter.
function defineIntegration
defineIntegration: <Fn extends IntegrationFn>( fn: Fn) => (...args: Parameters<Fn>) => Integration;
Define an integration function that can be used to create an integration instance. Note that this by design hides the implementation details of the integration, as they are considered internal.
function endSession
endSession: () => void;
End the session on the current isolation scope.
function extraErrorDataIntegration
extraErrorDataIntegration: ( options?: Partial<ExtraErrorDataOptions> | undefined) => any;
function flush
flush: (timeout?: number) => Promise<boolean>;
Call
flush()
on the current client, if there is one. See Client.flush.Parameter timeout
Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause the client to wait until all events are sent before resolving the promise.
Returns
A promise which resolves to
true
if the queue successfully drains before the timeout, orfalse
if it doesn't (or if there's no client defined).
function functionToStringIntegration
functionToStringIntegration: () => any;
Patch toString calls to return proper name for wrapped functions.
Sentry.init({integrations: [functionToStringIntegration(),],});
function getActiveSpan
getActiveSpan: () => Span | undefined;
Returns the currently active span.
function getCapturedScopesOnSpan
getCapturedScopesOnSpan: (span: Span) => { scope?: Scope; isolationScope?: Scope;};
Grabs the scope and isolation scope off a span that were active when the span was started.
function getClient
getClient: <C extends Client>() => C | undefined;
Get the currently active client.
function getCurrentHubShim
getCurrentHubShim: () => Hub;
This is for legacy reasons, and returns a proxy object instead of a hub to be used.
Deprecated
Use the methods directly from the top level Sentry API (e.g.
Sentry.withScope
) For more information see our migration guide for [replacinggetCurrentHub
andHub
](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub) usage
function getCurrentScope
getCurrentScope: () => Scope;
Get the currently active scope.
function getDefaultCurrentScope
getDefaultCurrentScope: () => Scope;
Get the default current scope.
function getDefaultIsolationScope
getDefaultIsolationScope: () => Scope;
Get the default isolation scope.
function getDynamicSamplingContextFromClient
getDynamicSamplingContextFromClient: ( trace_id: string, client: Client) => DynamicSamplingContext;
Creates a dynamic sampling context from a client.
Dispatches the
createDsc
lifecycle hook as a side effect.
function getDynamicSamplingContextFromSpan
getDynamicSamplingContextFromSpan: (span: Span) => DynamicSamplingContext;
Creates a dynamic sampling context from a span (and client and scope)
Parameter span
the span from which a few values like the root span name and sample rate are extracted.
Returns
a dynamic sampling context
function getEnvelopeEndpointWithUrlEncodedAuth
getEnvelopeEndpointWithUrlEncodedAuth: ( dsn: DsnComponents, tunnel?: string, sdkInfo?: SdkInfo) => string;
Returns the envelope endpoint URL with auth in the query string.
Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
function getGlobalScope
getGlobalScope: () => Scope;
Get the global scope. This scope is applied to _all_ events.
function getIntegrationsToSetup
getIntegrationsToSetup: ( options: Pick<Options, 'defaultIntegrations' | 'integrations'>) => Integration[];
Gets integrations to install
function getIsolationScope
getIsolationScope: () => Scope;
Get the currently active isolation scope. The isolation scope is active for the current exection context.
function getMainCarrier
getMainCarrier: () => Carrier;
Returns the global shim registry.
FIXME: This function is problematic, because despite always returning a valid Carrier, it has an optional
__SENTRY__
property, which then in turn requires us to always perform an unnecessary check at the call-site. We always access the carrier through this function, so we can guarantee that__SENTRY__
is there.
function getMetricSummaryJsonForSpan
getMetricSummaryJsonForSpan: ( span: Span) => Record<string, Array<MetricSummary>> | undefined;
Fetches the metric summary if it exists for the passed span
function getReportDialogEndpoint
getReportDialogEndpoint: ( dsnLike: DsnLike, dialogOptions: { [key: string]: any; user?: { name?: string; email?: string } }) => string;
Returns the url to the report dialog endpoint.
function getRootSpan
getRootSpan: (span: SpanWithPotentialChildren) => Span;
Returns the root span of a given span.
function getSpanDescendants
getSpanDescendants: (span: SpanWithPotentialChildren) => Span[];
Returns an array of the given span and all of its descendants.
function getSpanStatusFromHttpCode
getSpanStatusFromHttpCode: (httpStatus: number) => SpanStatus;
Converts a HTTP status code into a sentry status with a message.
Parameter httpStatus
The HTTP response status code.
Returns
The span status or unknown_error.
function getStatusMessage
getStatusMessage: (status: SpanStatus | undefined) => string | undefined;
Get the status message to use for a JSON representation of a span.
function getTraceData
getTraceData: () => SerializedTraceData;
Extracts trace propagation data from the current span or from the client's scope (via transaction or propagation context) and serializes it to
sentry-trace
andbaggage
values to strings. These values can be used to propagate a trace via our tracing Http headers or Html<meta>
tags.This function also applies some validation to the generated sentry-trace and baggage values to ensure that only valid strings are returned.
Returns
an object with the tracing data values. The object keys are the name of the tracing key to be used as header or meta tag name.
function getTraceMetaTags
getTraceMetaTags: () => string;
Returns a string of meta tags that represent the current trace data.
You can use this to propagate a trace from your server-side rendered Html to the browser. This function returns up to two meta tags,
sentry-trace
andbaggage
, depending on the current trace data state.Example 1
Usage example:
function renderHtml() {return `<head>${getTraceMetaTags()}</head>`;}
function handleCallbackErrors
handleCallbackErrors: <Fn extends () => any>( fn: Fn, onError: (error: unknown) => void, onFinally?: () => void) => ReturnType<Fn>;
Wrap a callback function with error handling. If an error is thrown, it will be passed to the
onError
callback and re-thrown.If the return value of the function is a promise, it will be handled with
maybeHandlePromiseRejection
.If an
onFinally
callback is provided, this will be called when the callback has finished - so if it returns a promise, once the promise resolved/rejected, else once the callback has finished executing. TheonFinally
callback will _always_ be called, no matter if an error was thrown or not.
function hasTracingEnabled
hasTracingEnabled: ( maybeOptions?: | Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'> | undefined) => boolean;
Determines if tracing is currently enabled.
Tracing is enabled when at least one of
tracesSampleRate
andtracesSampler
is defined in the SDK config.
function inboundFiltersIntegration
inboundFiltersIntegration: ( options?: Partial<InboundFiltersOptions> | undefined) => any;
function initAndBind
initAndBind: <F extends Client, O extends ClientOptions>( clientClass: ClientClass<F, O>, options: O) => Client;
Internal function to create a new SDK client instance. The client is installed and then bound to the current scope.
Parameter clientClass
The client class to instantiate.
Parameter options
Options to pass to the client.
function instrumentFetchRequest
instrumentFetchRequest: ( handlerData: HandlerDataFetch, shouldCreateSpan: (url: string) => boolean, shouldAttachHeaders: (url: string) => boolean, spans: Record<string, Span>, spanOrigin?: SpanOrigin) => Span | undefined;
Create and track fetch request spans for usage in combination with
addFetchInstrumentationHandler
.Returns
Span if a span was created, otherwise void.
function isEnabled
isEnabled: () => boolean;
If the SDK is initialized & enabled.
function isInitialized
isInitialized: () => boolean;
Returns true if Sentry has been properly initialized.
function isSentryRequestUrl
isSentryRequestUrl: (url: string, client: Client | undefined) => boolean;
Checks whether given url points to Sentry server
Parameter url
url to verify
function lastEventId
lastEventId: () => string | undefined;
The last error event id of the isolation scope.
Warning: This function really returns the last recorded error event id on the current isolation scope. If you call this function after handling a certain error and another error is captured in between, the last one is returned instead of the one you might expect. Also, ids of events that were never sent to Sentry (for example because they were dropped in
beforeSend
) could be returned.Returns
The last event id of the isolation scope.
function linkedErrorsIntegration
linkedErrorsIntegration: (options?: LinkedErrorsOptions | undefined) => any;
function logSpanEnd
logSpanEnd: (span: Span) => void;
Print a log message for an ended span.
function logSpanStart
logSpanStart: (span: Span) => void;
Print a log message for a started span.
function makeMultiplexedTransport
makeMultiplexedTransport: <TO extends BaseTransportOptions>( createTransport: (options: TO) => Transport, matcher: Matcher) => (options: TO) => Transport;
Creates a transport that can send events to different DSNs depending on the envelope contents.
function makeOfflineTransport
makeOfflineTransport: <TO>( createTransport: (options: TO) => Transport) => (options: TO & OfflineTransportOptions) => Transport;
Wraps a transport and stores and retries events when they fail to send.
Parameter createTransport
The transport to wrap.
function makeSession
makeSession: (context?: Omit<SessionContext, 'started' | 'status'>) => Session;
Creates a new
Session
object by setting certain default parameters. If optionalParameter context
is passed, the passed properties are applied to the session object.
Parameter context
(optional) additional properties to be applied to the returned session object
Returns
a new
Session
object
function mergeScopeData
mergeScopeData: (data: ScopeData, mergeData: ScopeData) => void;
Merge data of two scopes together.
function moduleMetadataIntegration
moduleMetadataIntegration: () => any;
Adds module metadata to stack frames.
Metadata can be injected by the Sentry bundler plugins using the
moduleMetadata
config option.When this integration is added, the metadata passed to the bundler plugin is added to the stack frames of all events under the
module_metadata
property. This can be used to help in tagging or routing of events from different teams our sources
function notifyEventProcessors
notifyEventProcessors: ( processors: EventProcessor[], event: Event | null, hint: EventHint, index?: number) => PromiseLike<Event | null>;
Process an array of event processors, returning the processed event (or
null
if the event was dropped).
function parameterize
parameterize: ( strings: TemplateStringsArray, ...values: string[]) => ParameterizedString;
Tagged template function which returns paramaterized representation of the message For example: parameterize
This is a log statement with ${x} and ${y} params
, would return: "__sentry_template_string__": 'This is a log statement with %s and %s params', "__sentry_template_values__": ['first', 'second']Parameter strings
An array of string values splitted between expressions
Parameter values
Expressions extracted from template string
Returns
String with template information in __sentry_template_string__ and __sentry_template_values__ properties
function parseSampleRate
parseSampleRate: (sampleRate: unknown) => number | undefined;
Parse a sample rate from a given value. This will either return a boolean or number sample rate, if the sample rate is valid (between 0 and 1). If a string is passed, we try to convert it to a number.
Any invalid sample rate will return
undefined
.
function prepareEvent
prepareEvent: ( options: ClientOptions, event: Event, hint: EventHint, scope?: ScopeInterface, client?: Client, isolationScope?: ScopeInterface) => PromiseLike<Event | null>;
Adds common information to events.
The information includes release and environment from
options
, breadcrumbs and context (extra, tags and user) from the scope.Information that is already present in the event is never overwritten. For nested objects, such as the context, keys are merged.
Parameter event
The original event.
Parameter hint
May contain additional information about the original exception.
Parameter scope
A scope containing event metadata.
Returns
A new event with more information.
function registerSpanErrorInstrumentation
registerSpanErrorInstrumentation: () => void;
Ensure that global errors automatically set the active span status.
function requestDataIntegration
requestDataIntegration: ( options?: RequestDataIntegrationOptions | undefined) => any;
Add data about a request to an event. Primarily for use in Node-based SDKs, but included in
@sentry/core
so it can be used in cross-platform SDKs like@sentry/nextjs
.
function rewriteFramesIntegration
rewriteFramesIntegration: (options?: RewriteFramesOptions | undefined) => any;
Rewrite event frames paths.
function sampleSpan
sampleSpan: ( options: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'>, samplingContext: SamplingContext) => [sampled: boolean, sampleRate?: number];
Makes a sampling decision for the given options.
Called every time a root span is created. Only root spans which emerge with a
sampled
value oftrue
will be sent to Sentry.
function sessionTimingIntegration
sessionTimingIntegration: () => any;
This function adds duration since the sessionTimingIntegration was initialized till the time event was sent.
function setAsyncContextStrategy
setAsyncContextStrategy: (strategy: AsyncContextStrategy | undefined) => void;
Private API with no semver guarantees!
Sets the global async context strategy
function setCapturedScopesOnSpan
setCapturedScopesOnSpan: ( span: Span | undefined, scope: Scope, isolationScope: Scope) => void;
Store the scope & isolation scope for a span, which can the be used when it is finished.
function setContext
setContext: (name: string, context: { [key: string]: any }) => void;
Sets context data with the given name.
Parameter name
of the context
Parameter context
Any kind of data. This data will be normalized.
function setCurrentClient
setCurrentClient: (client: Client) => void;
Make the given client the current client.
function setExtra
setExtra: (key: string, extra: Extra) => void;
Set key:value that will be sent as extra data with the event.
Parameter key
String of extra
Parameter extra
Any kind of data. This data will be normalized.
function setExtras
setExtras: (extras: Extras) => void;
Set an object that will be merged sent as extra data with the event.
Parameter extras
Extras object to merge into current context.
function setHttpStatus
setHttpStatus: (span: Span, httpStatus: number) => void;
Sets the Http status attributes on the current span based on the http code. Additionally, the span's status is updated, depending on the http code.
function setMeasurement
setMeasurement: ( name: string, value: number, unit: MeasurementUnit, activeSpan?: import('@sentry/types').Span | undefined) => void;
Adds a measurement to the active transaction on the current global scope. You can optionally pass in a different span as the 4th parameter.
function setTag
setTag: (key: string, value: Primitive) => void;
Set key:value that will be sent as tags data with the event.
Can also be used to unset a tag, by passing
undefined
.Parameter key
String key of tag
Parameter value
Value of tag
function setTags
setTags: (tags: { [key: string]: Primitive }) => void;
Set an object that will be merged sent as tags data with the event.
Parameter tags
Tags context object to merge into current context.
function setUser
setUser: (user: User | null) => void;
Updates user context information for future events.
Parameter user
User context object to be set in the current context. Pass
null
to unset the user.
function spanIsSampled
spanIsSampled: (span: Span) => boolean;
Returns true if a span is sampled. In most cases, you should just use
span.isRecording()
instead. However, this has a slightly different semantic, as it also returns false if the span is finished. So in the case where this distinction is important, use this method.
function spanTimeInputToSeconds
spanTimeInputToSeconds: (input: SpanTimeInput | undefined) => number;
Convert a span time input into a timestamp in seconds.
function spanToBaggageHeader
spanToBaggageHeader: (span: Span) => string | undefined;
Convert a Span to a baggage header.
function spanToJSON
spanToJSON: (span: Span) => SpanJSON;
Convert a span to a JSON representation.
function spanToTraceContext
spanToTraceContext: (span: Span) => TraceContext;
Convert a span to a trace context, which can be sent as the
trace
context in a non-transaction event.
function spanToTraceHeader
spanToTraceHeader: (span: Span) => string;
Convert a Span to a Sentry trace header.
function startIdleSpan
startIdleSpan: ( startSpanOptions: StartSpanOptions, options?: Partial<IdleSpanOptions>) => Span;
An idle span is a span that automatically finishes. It does this by tracking child spans as activities. An idle span is always the active span.
function startInactiveSpan
startInactiveSpan: (options: StartSpanOptions) => Span;
Creates a span. This span is not set as active, so will not get automatic instrumentation spans as children or be able to be accessed via
Sentry.getActiveSpan()
.If you want to create a span that is set as active, use startSpan.
This function will always return a span, it may just be a non-recording span if the span is not sampled or if tracing is disabled.
function startNewTrace
startNewTrace: <T>(callback: () => T) => T;
Starts a new trace for the duration of the provided callback. Spans started within the callback will be part of the new trace instead of a potentially previously started trace.
Important: Only use this function if you want to override the default trace lifetime and propagation mechanism of the SDK for the duration and scope of the provided callback. The newly created trace will also be the root of a new distributed trace, for example if you make http requests within the callback. This function might be useful if the operation you want to instrument should not be part of a potentially ongoing trace.
Default behavior: - Server-side: A new trace is started for each incoming request. - Browser: A new trace is started for each page our route. Navigating to a new route or page will automatically create a new trace.
function startSession
startSession: (context?: SessionContext) => Session;
Start a session on the current isolation scope.
Parameter context
(optional) additional properties to be applied to the returned session object
Returns
the new active session
function startSpan
startSpan: <T>(options: StartSpanOptions, callback: (span: Span) => T) => T;
Wraps a function with a transaction/span and finishes the span after the function is done. The created span is the active span and will be used as parent by other spans created inside the function and can be accessed via
Sentry.getActiveSpan()
, as long as the function is executed while the scope is active.If you want to create a span that is not set as active, use startInactiveSpan.
You'll always get a span passed to the callback, it may just be a non-recording span if the span is not sampled or if tracing is disabled.
function startSpanManual
startSpanManual: <T>( options: StartSpanOptions, callback: (span: Span, finish: () => void) => T) => T;
Similar to
Sentry.startSpan
. Wraps a function with a transaction/span, but does not finish the span after the function is done automatically. You'll have to callspan.end()
manually.The created span is the active span and will be used as parent by other spans created inside the function and can be accessed via
Sentry.getActiveSpan()
, as long as the function is executed while the scope is active.You'll always get a span passed to the callback, it may just be a non-recording span if the span is not sampled or if tracing is disabled.
function suppressTracing
suppressTracing: <T>(callback: () => T) => T;
Suppress tracing in the given callback, ensuring no spans are generated inside of it.
function thirdPartyErrorFilterIntegration
thirdPartyErrorFilterIntegration: (options: Options) => any;
This integration allows you to filter out, or tag error events that do not come from user code marked with a bundle key via the Sentry bundler plugins.
function timedEventsToMeasurements
timedEventsToMeasurements: (events: TimedEvent[]) => Measurements | undefined;
Convert timed events to measurements.
function trpcMiddleware
trpcMiddleware: ( options?: SentryTrpcMiddlewareOptions) => <T>(opts: SentryTrpcMiddlewareArguments<T>) => SentryTrpcMiddleware<T>;
Sentry tRPC middleware that captures errors and creates spans for tRPC procedures.
function updateSession
updateSession: (session: Session, context?: SessionContext) => void;
Updates a session object with the properties passed in the context.
Note that this function mutates the passed object and returns void. (Had to do this instead of returning a new and updated session because closing and sending a session makes an update to the session after it was passed to the sending logic.
Parameter session
the
Session
to updateParameter context
the
SessionContext
holding the properties that should be updated inParameter session
See Also
BaseClient.captureSession )
function withActiveSpan
withActiveSpan: <T>(span: Span | null, callback: (scope: Scope) => T) => T;
Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be passed
null
to start an entirely new span tree.Parameter span
Spans started in the context of the provided callback will be children of this span. If
null
is passed, spans started within the callback will not be attached to a parent span.Parameter callback
Execution context in which the provided span will be active. Is passed the newly forked scope.
Returns
the value returned from the provided callback function.
function withIsolationScope
withIsolationScope: { <T>(callback: (isolationScope: Scope) => T): T; <T>(isolationScope: any, callback: (isolationScope: Scope) => T): T;};
Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the case, for example, in the browser).
Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.
This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in "normal" applications directly because it comes with pitfalls. Use at your own risk!
Set the provided isolation scope as active in the given callback. If no async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the case, for example, in the browser).
Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.
This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in "normal" applications directly because it comes with pitfalls. Use at your own risk!
If you pass in
undefined
as a scope, it will fork a new isolation scope, the same as if no scope is passed.
function withMonitor
withMonitor: <T>( monitorSlug: CheckIn, callback: () => T, upsertMonitorConfig?: MonitorConfig) => T;
Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.
Parameter monitorSlug
The distinct slug of the monitor.
Parameter upsertMonitorConfig
An optional object that describes a monitor config. Use this if you want to create a monitor automatically when sending a check in.
function withScope
withScope: { <T>(callback: (scope: Scope) => T): T; <T>(scope: any, callback: (scope: Scope) => T): T;};
Creates a new scope with and executes the given operation within. The scope is automatically removed once the operation finishes or throws.
Set the given scope as the active scope in the callback.
function zodErrorsIntegration
zodErrorsIntegration: (options?: ZodErrorsOptions | undefined) => any;
Classes
class BaseClient
abstract class BaseClient<O extends ClientOptions> implements Client<O> {}
Base implementation for all JavaScript SDK clients.
Call the constructor with the corresponding options specific to the client subclass. To access these options later, use Client.getOptions.
If a Dsn is specified in the options, it will be parsed and stored. Use Client.getDsn to retrieve the Dsn at any moment. In case the Dsn is invalid, the constructor will throw a SentryException. Note that without a valid Dsn, the SDK will not send any events to Sentry.
Before sending an event, it is passed through BaseClient._prepareEvent to add SDK information and scope data (breadcrumbs and context). To add more custom information, override this method and extend the resulting prepared event.
To issue automatically created events (e.g. via instrumentation), use Client.captureEvent. It will prepare the event and pass it through the callback lifecycle. To issue auto-breadcrumbs, use Client.addBreadcrumb.
Example 1
class NodeClient extends BaseClient { public constructor(options: NodeOptions) { super(options); }
// ... }
constructor
protected constructor(options: ClientOptions);
Initializes this client instance.
Parameter options
Options for the client.
method addEventProcessor
addEventProcessor: (eventProcessor: EventProcessor) => void;
method addIntegration
addIntegration: (integration: Integration) => void;
method captureEvent
captureEvent: ( event: Event, hint?: EventHint, currentScope?: ScopeInterface) => string;
method captureException
captureException: ( exception: any, hint?: EventHint, scope?: ScopeInterface) => string;
method captureMessage
captureMessage: ( message: ParameterizedString, level?: SeverityLevel, hint?: EventHint, currentScope?: ScopeInterface) => string;
method captureSession
captureSession: (session: Session) => void;
method close
close: (timeout?: number) => PromiseLike<boolean>;
method emit
emit: { ( hook: 'beforeSampling', samplingData: { spanAttributes: SpanAttributes; spanName: string; parentSampled?: boolean; parentContext?: SpanContextData; }, samplingDecision: { decision: boolean } ): void; (hook: 'spanStart', span: Span): void; (hook: 'spanEnd', span: Span): void; (hook: 'idleSpanEnableAutoFinish', span: Span): void; (hook: 'beforeEnvelope', envelope: Envelope): void; (hook: 'beforeSendEvent', event: Event, hint?: EventHint): void; (hook: 'preprocessEvent', event: Event, hint?: EventHint): void; ( hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse ): void; ( hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint ): void; (hook: 'createDsc', dsc: DynamicSamplingContext, rootSpan?: Span): void; ( hook: 'beforeSendFeedback', feedback: FeedbackEvent, options?: { includeReplay: boolean } ): void; ( hook: 'startPageLoadSpan', options: StartSpanOptions, traceOptions?: { sentryTrace?: string; baggage?: string } ): void; (hook: 'startNavigationSpan', options: StartSpanOptions): void; (hook: 'flush'): void; (hook: 'close'): void; (hook: 'applyFrameMetadata', event: Event): void;};
method eventFromException
abstract eventFromException: ( _exception: any, _hint?: EventHint) => PromiseLike<Event>;
method eventFromMessage
abstract eventFromMessage: ( _message: ParameterizedString, _level?: SeverityLevel, _hint?: EventHint) => PromiseLike<Event>;
method flush
flush: (timeout?: number) => PromiseLike<boolean>;
method getDsn
getDsn: () => DsnComponents | undefined;
method getEventProcessors
getEventProcessors: () => EventProcessor[];
Get all installed event processors.
method getIntegrationByName
getIntegrationByName: <T extends Integration = Integration>( integrationName: string) => T | undefined;
Gets an installed integration by its name.
Returns
The installed integration or
undefined
if no integration with thatname
was installed.
method getOptions
getOptions: () => O;
method getSdkMetadata
getSdkMetadata: () => SdkMetadata | undefined;
See Also
SdkMetadata in @sentry/types
The metadata of the SDK
method getTransport
getTransport: () => Transport | undefined;
method init
init: () => void;
method on
on: { (hook: 'spanStart', callback: (span: Span) => void): () => void; (hook: 'spanEnd', callback: (span: Span) => void): () => void; ( hook: 'idleSpanEnableAutoFinish', callback: (span: Span) => void ): () => void; (hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): () => void; ( hook: 'beforeSendEvent', callback: (event: Event, hint?: EventHint) => void ): () => void; ( hook: 'preprocessEvent', callback: (event: Event, hint?: EventHint) => void ): () => void; ( hook: 'afterSendEvent', callback: ( event: Event, sendResponse: TransportMakeRequestResponse ) => void ): () => void; ( hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void ): () => void; ( hook: 'createDsc', callback: (dsc: DynamicSamplingContext, rootSpan?: Span) => void ): () => void; ( hook: 'beforeSendFeedback', callback: ( feedback: FeedbackEvent, options?: { includeReplay: boolean } ) => void ): () => void; ( hook: 'beforeSampling', callback: ( samplingData: { spanAttributes: SpanAttributes; spanName: string; parentSampled?: boolean; parentContext?: SpanContextData; }, samplingDecision: { decision: boolean } ) => void ): void; ( hook: 'startPageLoadSpan', callback: ( options: StartSpanOptions, traceOptions?: { sentryTrace?: string; baggage?: string } ) => void ): () => void; ( hook: 'startNavigationSpan', callback: (options: StartSpanOptions) => void ): () => void; (hook: 'flush', callback: () => void): () => void; (hook: 'close', callback: () => void): () => void; (hook: 'applyFrameMetadata', callback: (event: Event) => void): () => void;};
method recordDroppedEvent
recordDroppedEvent: ( reason: EventDropReason, category: DataCategory, eventOrCount?: Event | number) => void;
method sendEnvelope
sendEnvelope: (envelope: Envelope) => PromiseLike<TransportMakeRequestResponse>;
method sendEvent
sendEvent: (event: Event, hint?: EventHint) => void;
method sendSession
sendSession: (session: Session | SessionAggregates) => void;
class BrowserMetricsAggregator
class BrowserMetricsAggregator implements MetricsAggregator {}
A simple metrics aggregator that aggregates metrics in memory and flushes them periodically. Default flush interval is 5 seconds.
This API is experimental and might change in the future.
Modifiers
@experimental
constructor
constructor(_client: Client);
method add
add: ( metricType: MetricType, unsanitizedName: string, value: number | string, unsanitizedUnit?: MeasurementUnit | undefined, unsanitizedTags?: Record<string, Primitive> | undefined, maybeFloatTimestamp?: number | undefined) => void;
method close
close: () => void;
method flush
flush: () => void;
class SentryNonRecordingSpan
class SentryNonRecordingSpan implements Span {}
A Sentry Span that is non-recording, meaning it will not be sent to Sentry.
constructor
constructor(spanContext?: SentrySpanArguments);
method addEvent
addEvent: ( _name: string, _attributesOrStartTime?: SpanAttributes | SpanTimeInput, _startTime?: SpanTimeInput) => this;
method end
end: (_timestamp?: SpanTimeInput) => void;
method isRecording
isRecording: () => boolean;
method setAttribute
setAttribute: (_key: string, _value: SpanAttributeValue | undefined) => this;
method setAttributes
setAttributes: (_values: SpanAttributes) => this;
method setStatus
setStatus: (_status: SpanStatus) => this;
method spanContext
spanContext: () => SpanContextData;
method updateName
updateName: (_name: string) => this;
class SentrySpan
class SentrySpan implements Span {}
Span contains all data about a span
method addEvent
addEvent: ( name: string, attributesOrStartTime?: SpanAttributes | SpanTimeInput, startTime?: SpanTimeInput) => this;
method end
end: (endTimestamp?: SpanTimeInput) => void;
method isRecording
isRecording: () => boolean;
method setAttribute
setAttribute: (key: string, value: SpanAttributeValue | undefined) => this;
method setAttributes
setAttributes: (attributes: SpanAttributes) => this;
method setStatus
setStatus: (value: SpanStatus) => this;
method spanContext
spanContext: () => SpanContextData;
method updateName
updateName: (name: string) => this;
class ServerRuntimeClient
class ServerRuntimeClient< O extends ClientOptions & ServerRuntimeClientOptions = ServerRuntimeClientOptions> extends BaseClient<O> {}
The Sentry Server Runtime Client SDK.
constructor
constructor(options: {});
Creates a new Edge SDK instance.
Parameter options
Configuration options for this SDK.
method captureCheckIn
captureCheckIn: ( checkIn: CheckIn, monitorConfig?: MonitorConfig, scope?: ScopeInterface) => string;
Create a cron monitor check in and send it to Sentry.
Parameter checkIn
An object that describes a check in.
Parameter upsertMonitorConfig
An optional object that describes a monitor config. Use this if you want to create a monitor automatically when sending a check in.
method captureEvent
captureEvent: (event: Event, hint?: EventHint, scope?: ScopeInterface) => string;
method captureException
captureException: ( exception: any, hint?: EventHint, scope?: ScopeInterface) => string;
method close
close: (timeout?: number) => PromiseLike<boolean>;
method eventFromException
eventFromException: (exception: unknown, hint?: EventHint) => PromiseLike<Event>;
method eventFromMessage
eventFromMessage: ( message: ParameterizedString, level?: SeverityLevel, hint?: EventHint) => PromiseLike<Event>;
method initSessionFlusher
initSessionFlusher: () => void;
Method that initialises an instance of SessionFlusher on Client
class SessionFlusher
class SessionFlusher implements SessionFlusherLike {}
constructor
constructor(client: Client, attrs: ReleaseHealthAttributes);
property flushTimeout
readonly flushTimeout: number;
method close
close: () => void;
JSDoc
method flush
flush: () => void;
Checks if
pendingAggregates
has entries, and if it does flushes them by callingsendSession
method getSessionAggregates
getSessionAggregates: () => SessionAggregates;
Massages the entries in
pendingAggregates
and returns aggregated sessions
method incrementSessionStatusCount
incrementSessionStatusCount: () => void;
Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then fetches the session status of the request from
Scope.getRequestSession().status
on the scope and passes them to_incrementSessionStatusCount
along with the start date
Interfaces
interface AsyncContextStrategy
interface AsyncContextStrategy {}
Private API with no semver guarantees!
Strategy used to track async context.
property getActiveSpan
getActiveSpan?: typeof getActiveSpan;
Get the currently active span.
property getCurrentScope
getCurrentScope: () => Scope;
Get the currently active scope.
property getIsolationScope
getIsolationScope: () => Scope;
Get the currently active isolation scope.
property getTraceData
getTraceData?: typeof getTraceData;
Get trace data as serialized string values for propagation via
sentry-trace
andbaggage
.
property startInactiveSpan
startInactiveSpan?: typeof startInactiveSpan;
Start an inactive span.
property startSpan
startSpan?: typeof startSpan;
Start an active span.
property startSpanManual
startSpanManual?: typeof startSpanManual;
Start an active manual span.
property suppressTracing
suppressTracing?: typeof suppressTracing;
Suppress tracing in the given callback, ensuring no spans are generated inside of it.
property withActiveSpan
withActiveSpan?: typeof withActiveSpan;
Make a span the active span in the context of the callback.
property withIsolationScope
withIsolationScope: <T>(callback: (isolationScope: Scope) => T) => T;
Fork the isolation scope inside of the provided callback.
property withScope
withScope: <T>(callback: (isolationScope: Scope) => T) => T;
Fork the current scope inside of the provided callback.
property withSetIsolationScope
withSetIsolationScope: <T>( isolationScope: Scope, callback: (isolationScope: Scope) => T) => T;
Set the provided isolation as the current isolation scope inside of the provided callback.
property withSetScope
withSetScope: <T>(scope: Scope, callback: (scope: Scope) => T) => T;
Set the provided scope as the current scope inside of the provided callback.
interface Carrier
interface Carrier {}
An object that contains globally accessible properties and maintains a scope stack.
interface OfflineStore
interface OfflineStore {}
interface OfflineTransportOptions
interface OfflineTransportOptions extends InternalBaseTransportOptions {}
property createStore
createStore?: CreateOfflineStore;
A function that creates the offline store instance.
property flushAtStartup
flushAtStartup?: boolean;
Flush the offline store shortly after startup.
Defaults: false
property shouldStore
shouldStore?: ( envelope: Envelope, error: Error, retryDelay: number) => boolean | Promise<boolean>;
Called before an event is stored.
Return false to drop the envelope rather than store it.
Parameter envelope
The envelope that failed to send.
Parameter error
The error that occurred.
Parameter retryDelay
The current retry delay in milliseconds.
interface ServerRuntimeClientOptions
interface ServerRuntimeClientOptions extends ClientOptions<BaseTransportOptions> {}
property platform
platform?: string;
property runtime
runtime?: { name: string; version?: string;};
property serverName
serverName?: string;
Type Aliases
type IntegrationIndex
type IntegrationIndex = { [key: string]: Integration;};
Map of integrations assigned to a client
type RequestDataIntegrationOptions
type RequestDataIntegrationOptions = { /** * Controls what data is pulled from the request and added to the event */ include?: { cookies?: boolean; data?: boolean; headers?: boolean; ip?: boolean; query_string?: boolean; url?: boolean; user?: | boolean | { id?: boolean; username?: boolean; email?: boolean; }; }; /** Whether to identify transactions by parameterized path, parameterized path with method, or handler name */ transactionNamingScheme?: TransactionNamingScheme;};
type Scope
type Scope = ScopeInterface;
Holds additional event information.
type SentryCoreCurrentScopes
type ClientClass<F extends Client, O extends ClientOptions> = new (options: O) => F;
A class object that can instantiate Client objects.
Package Files (69)
- build/types/api.d.ts
- build/types/asyncContext/index.d.ts
- build/types/asyncContext/types.d.ts
- build/types/baseclient.d.ts
- build/types/breadcrumbs.d.ts
- build/types/carrier.d.ts
- build/types/checkin.d.ts
- build/types/constants.d.ts
- build/types/currentScopes.d.ts
- build/types/defaultScopes.d.ts
- build/types/envelope.d.ts
- build/types/eventProcessors.d.ts
- build/types/exports.d.ts
- build/types/feedback.d.ts
- build/types/fetch.d.ts
- build/types/getCurrentHubShim.d.ts
- build/types/index.d.ts
- build/types/integration.d.ts
- build/types/integrations/captureconsole.d.ts
- build/types/integrations/debug.d.ts
- build/types/integrations/dedupe.d.ts
- build/types/integrations/extraerrordata.d.ts
- build/types/integrations/functiontostring.d.ts
- build/types/integrations/inboundfilters.d.ts
- build/types/integrations/linkederrors.d.ts
- build/types/integrations/metadata.d.ts
- build/types/integrations/requestdata.d.ts
- build/types/integrations/rewriteframes.d.ts
- build/types/integrations/sessiontiming.d.ts
- build/types/integrations/third-party-errors-filter.d.ts
- build/types/integrations/zoderrors.d.ts
- build/types/metrics/browser-aggregator.d.ts
- build/types/metrics/exports-default.d.ts
- build/types/metrics/exports.d.ts
- build/types/metrics/metric-summary.d.ts
- build/types/profiling.d.ts
- build/types/scope.d.ts
- build/types/sdk.d.ts
- build/types/semanticAttributes.d.ts
- build/types/server-runtime-client.d.ts
- build/types/session.d.ts
- build/types/sessionflusher.d.ts
- build/types/tracing/dynamicSamplingContext.d.ts
- build/types/tracing/errors.d.ts
- build/types/tracing/hubextensions.d.ts
- build/types/tracing/idleSpan.d.ts
- build/types/tracing/logSpans.d.ts
- build/types/tracing/measurement.d.ts
- build/types/tracing/sampling.d.ts
- build/types/tracing/sentryNonRecordingSpan.d.ts
- build/types/tracing/sentrySpan.d.ts
- build/types/tracing/spanstatus.d.ts
- build/types/tracing/trace.d.ts
- build/types/tracing/utils.d.ts
- build/types/transports/base.d.ts
- build/types/transports/multiplexed.d.ts
- build/types/transports/offline.d.ts
- build/types/trpc.d.ts
- build/types/utils/applyScopeDataToEvent.d.ts
- build/types/utils/handleCallbackErrors.d.ts
- build/types/utils/hasTracingEnabled.d.ts
- build/types/utils/isSentryRequestUrl.d.ts
- build/types/utils/meta.d.ts
- build/types/utils/parameterize.d.ts
- build/types/utils/parseSampleRate.d.ts
- build/types/utils/prepareEvent.d.ts
- build/types/utils/sdkMetadata.d.ts
- build/types/utils/spanUtils.d.ts
- build/types/utils/traceData.d.ts
Dependencies (2)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@sentry/core
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@sentry/core)
- HTML<a href="https://www.jsdocs.io/package/@sentry/core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 8565 ms. - Missing or incorrect documentation? Open an issue for this package.