Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/sentry_deno/main.ts>Hub

Unofficial port of the Sentry SDK for JavaScript to Deno.
Latest
class Hub
implements HubInterface
import { Hub } from "https://deno.land/x/sentry_deno@v0.2.2/main.ts";

Constructors

new
Hub(
client?: Client,
scope?: Scope,
_version?: number,
)

Creates a new instance of the hub, will push one Layer into the internal stack on creation.

Properties

private
optional
_lastEventId: string

Contains the last event id of a captured event.

private
readonly
_stack: Layer[]

Is a Layer[] containing the client and scope

Methods

private
_callExtensionMethod<T>(method: string, ...args: any[]): T

Calls global extension method and binding current instance to the function call

private
_sendSessionUpdate(): void

Sends the current Session on the scope

private
_withClient(callback: (client: Client, scope: Scope | undefined) => void): void

Internal helper function to call a method on the top client if it exists.

addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void
bindClient(client?: Client): void
captureEvent(event: Event, hint?: EventHint): string
captureException(exception: any, hint?: EventHint): string
captureMessage(
message: string,
hint?: EventHint,
): string
captureSession(endSession?: boolean): void
configureScope(callback: (scope: Scope) => void): void
endSession(): void
getClient<C extends Client>(): C | undefined
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null
getScope(): Scope | undefined

Returns the scope of the top stack.

getStack(): Layer[]

Returns the scope stack for domains or the process.

getStackTop(): Layer

Returns the topmost scope layer in the order domain > local > process.

isOlderThan(version: number): boolean
lastEventId(): string | undefined
popScope(): boolean
run(callback: (hub: Hub) => void): void
setContext(name: string, context: { [key: string]: any; } | null): void
setExtra(key: string, extra: Extra): void
setExtras(extras: Extras): void
setTag(key: string, value: Primitive): void
setTags(tags: { [key: string]: Primitive; }): void
setUser(user: User | null): void

Returns if default PII should be sent to Sentry and propagated in ourgoing requests when Tracing is used.

startSession(context?: SessionContext): Session
startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction
traceHeaders(): { [key: string]: string; }
withScope(callback: (scope: Scope) => void): void