Skip to main content
Module

x/sentry/index.d.ts>Scope

The Official Sentry Deno SDK
Go to Latest
class Scope
implements Scope$1
import { Scope } from "https://deno.land/x/sentry@7.91.0/index.d.ts";

Holds additional event information. Scope.applyToEvent will be called by the client before an event will be sent.

Constructors

new
Scope()

Properties

protected
_attachments: Attachment[]

Attachments

protected
_breadcrumbs: Breadcrumb[]

Array of breadcrumbs.

protected
_contexts: Contexts

Contexts

protected
_eventProcessors: EventProcessor[]

Callback list that will be called after applyToEvent.

protected
_extra: Extras

Extra

protected
optional
_fingerprint: string[]

Fingerprint

protected
optional
_level: Severity | SeverityLevel

Severity

protected
_notifyingListeners: boolean

Flag if notifying is happening.

protected
_propagationContext: PropagationContext

Propagation Context for distributed tracing

protected
optional
_requestSession: RequestSession

Request Mode Session Status

protected
_scopeListeners: Array<(scope: Scope) => void>

Callback for client to receive scope changes.

protected
_sdkProcessingMetadata: { [key: string]: unknown; }

A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get sent to Sentry

protected
optional
_session: Session

Session

protected
optional
_span: Span$1

Span

protected
_tags: { [key: string]: Primitive; }

Tags

protected
optional
_transactionName: string

Transaction Name

protected
_user: User

User

Methods

protected
_notifyScopeListeners(): void

This will be called on every set call.

addAttachment(attachment: Attachment): this
addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this
addEventProcessor(callback: EventProcessor): this
addScopeListener(callback: (scope: Scope) => void): void

Add internal on change listener. Used for sub SDKs that need to store the scope.

deprecated
applyToEvent(
event: Event,
hint?: EventHint,
additionalEventProcessors?: EventProcessor[],
): PromiseLike<Event | null>

Applies data from the scope to the event and runs all event processors on it.

clear(): this

Clone this scope instance.

deprecated
getAttachments(): Attachment[]
getPropagationContext(): PropagationContext
getRequestSession(): RequestSession | undefined
getScopeData(): ScopeData
getSession(): Session | undefined
getSpan(): Span$1 | undefined
getUser(): User | undefined
setContext(key: string, context: Context | null): this
setExtra(key: string, extra: Extra): this
setExtras(extras: Extras): this
setFingerprint(fingerprint: string[]): this
setPropagationContext(context: PropagationContext): this
setRequestSession(requestSession?: RequestSession): this
setSDKProcessingMetadata(newData: { [key: string]: unknown; }): this

Add data which will be accessible during event processing but won't get sent to Sentry

setSession(session?: Session): this
setSpan(span?: Span$1): this
setTag(key: string, value: Primitive): this
setTags(tags: { [key: string]: Primitive; }): this
setTransactionName(name?: string): this
setUser(user: User | null): this
update(captureContext?: CaptureContext): this

Static Methods

deprecated
clone(scope?: Scope): Scope

Inherit values from the parent scope.