getsentry / getsentry/sentry-javascript

deno: `init()` never registers the channel-injection hooks, though Deno supports them

Aperta
#23,892 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Bug Deno javascript
Lingua principale
TypeScript
Stelle
8.7k
Fork
1.8k
Merge medio
1g 17h
PR unite (30g)
515

Descrizione

Deno 2.9.2 has a working `Module.registerHooks`, and `hasStableSyncModuleHooks` already returns `true` for Deno unconditionally (`register.ts:20`). Calling the register function directly works:

```
$ deno run -A reg.mjs
marker after register: {"runtime":[]} # hooks registered
```

But `@sentry/deno`'s `init()` never calls it:

```
$ deno run -A nospans.mjs
orchestrion marker: undefined
```

Node's `init()` calls `registerDiagnosticsChannelInjection()` and then `detectOrchestrionSetup()`. Deno instead expects the user to remember `deno run --import=@sentry/deno/import app.ts`, and gives no warning at all if they forget. All 22 channel integrations still install and report `Integration installed`.

**Work item.** Call `registerDiagnosticsChannelInjection()` from `@sentry/deno`'s `init()` behind the same `enableRuntimeChannelInjection` option Node uses, and call `detectOrchestrionSetup()` after client creation. Keep `@sentry/deno/import` working for the case where modules are imported before `init()`.

**Prior art ***(related history only)*. getsentry/sentry-javascript#21451 (merged) added the `@sentry/deno/import` runtime hook, and getsentry/sentry-javascript#22790 (merged) raised the floor to Deno >= 2.8.3, which is what makes the `Module.registerHooks` path safe to call unconditionally. No issue covers calling it from `init()`.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start in the @sentry/deno init() implementation and inspect register.ts:20, where hasStableSyncModuleHooks is defined. Trace registerDiagnosticsChannelInjection(), detectOrchestrionSetup(), and the @sentry/deno/import entry point before changing initialization. Done means init() honors enableRuntimeChannelInjection, detects missing setup after client creation, and preserves imports that run before init().

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
deno, typescript
Ambito
backend
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
74/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.