Skip to main content
Module

x/sentry/index.mjs>Scope

The Official Sentry Deno SDK
Go to Latest
class Scope
implements Scope$1
import { Scope } from "https://deno.land/x/sentry@8.0.0-beta.4/index.mjs";

Holds additional event information.

Constructors

new
Scope()

Properties

protected
_attachments: Attachment[]

Attachments

protected
_breadcrumbs: Breadcrumb[]

Array of breadcrumbs.

protected
optional
_client: Client

The client on this scope

protected
_contexts: Contexts

Contexts

protected
_eventProcessors: EventProcessor[]

Callback list that will be called during event processing.

protected
_extra: Extras

Extra

protected
optional
_fingerprint: string[]

Fingerprint

protected
optional
_level: 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
_tags: { [key: string]: Primitive; }

Tags

protected
optional
_transactionName: string

Transaction Name

IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects. It's purpose is to assign a transaction to the scope that's added to non-transaction events.

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
captureEvent(event: Event, hint?: EventHint): string
captureException(exception: unknown, hint?: EventHint): string
captureMessage(
message: string,
level?: SeverityLevel,
hint?: EventHint,
): string
clear(): this
getClient<C extends Client>(): C | undefined
getPropagationContext(): PropagationContext
getRequestSession(): RequestSession | undefined
getScopeData(): ScopeData
getSession(): Session | undefined
getUser(): User | undefined
setClient(client: Client | undefined): void
setContext(key: string, context: Context | null): this
setExtra(key: string, extra: Extra): this
setExtras(extras: Extras): this
setFingerprint(fingerprint: string[]): this
setLevel(level: SeverityLevel): this
setPropagationContext(context: PropagationContext): this
setRequestSession(requestSession?: RequestSession): this
setSDKProcessingMetadata(newData: { [key: string]: unknown; }): this
setSession(session?: Session): 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