getsentry / getsentry/sentry-javascript

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

Aberta
#23,892 1 comentário 0 reações 0 responsáveis Ver no GitHub
Bug Deno javascript
Linguagem predominante
TypeScript
Estrelas
8.7k
Forks
1.8k
Merge médio
1d 18h
PRs com merge (30d)
541

Descrição

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()`.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece pela implementação de init() de @sentry/deno e inspecione register.ts:20, onde hasStableSyncModuleHooks é definido. Rastreie registerDiagnosticsChannelInjection(), detectOrchestrionSetup() e o ponto de entrada @sentry/deno/import antes de alterar a inicialização. O trabalho estará concluído quando init() respeitar enableRuntimeChannelInjection, detectar uma configuração ausente após a criação do cliente e preservar os imports executados antes de init().

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
deno, typescript
Domínio
backend
Tipo de issue
Funcionalidade
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Ativa
Clareza
Claramente especificada
Facilidade para iniciantes
74/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.