File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ export type { DenoRedisIntegrationOptions } from './integrations/redis';
114114export { denoMysqlIntegration } from './integrations/mysql' ;
115115export { denoPostgresIntegration } from './integrations/postgres' ;
116116export { denoAmqplibIntegration } from './integrations/amqplib' ;
117+ export { denoDataloaderIntegration } from './integrations/dataloader' ;
117118export { denoContextIntegration } from './integrations/context' ;
118119export { globalHandlersIntegration } from './integrations/globalhandlers' ;
119120export { normalizePathsIntegration } from './integrations/normalizepaths' ;
Original file line number Diff line number Diff line change 1+ import { dataloaderChannelIntegration } from '@sentry/server-utils/orchestrion' ;
2+ import type { Integration , IntegrationFn } from '@sentry/core' ;
3+ import { defineIntegration , extendIntegration } from '@sentry/core' ;
4+ import { setAsyncLocalStorageAsyncContextStrategy } from '../async' ;
5+
6+ const INTEGRATION_NAME = 'DenoDataloader' as const ;
7+
8+ /**
9+ * Create spans for `dataloader` load/batch operations under Deno.
10+ *
11+ * `dataloader` channels are injected by the orchestrion runtime hook at load time.
12+ * The `@sentry/deno/import` loader must be active for this integration to
13+ * record anything.
14+ *
15+ * The channel-subscription logic is shared with the other server runtimes in
16+ * `@sentry/server-utils`. This just installs Deno's `AsyncLocalStorage` context
17+ * strategy (so spans nest under the active span and survive dataloader's deferred
18+ * batch dispatch) before delegating.
19+ */
20+ const _denoDataloaderIntegration = ( ( ) => {
21+ const inner = dataloaderChannelIntegration ( ) ;
22+
23+ return extendIntegration ( inner , {
24+ name : INTEGRATION_NAME ,
25+ setupOnce ( ) {
26+ setAsyncLocalStorageAsyncContextStrategy ( ) ;
27+ } ,
28+ } ) ;
29+ } ) satisfies IntegrationFn ;
30+
31+ export const denoDataloaderIntegration = defineIntegration ( _denoDataloaderIntegration ) as ( ) => Integration & {
32+ name : 'DenoDataloader' ;
33+ setupOnce : ( ) => void ;
34+ } ;
You can’t perform that action at this time.
0 commit comments