start.node: node.js imports node:http before start.instrument runs, so HTTP instrumentation misses the server
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 30/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- node.js, typescript, vite
- Domínio
- build-system, observability
Direção de pesquisa
The problem is the static import order in the emitted dist/server/node.js, where node:http loads before start.instrument runs inside ./server.js. Start in the plugin code that generates the node entry and check how it orders the node:* imports relative to the instrument and handler imports. Done means that with instrument set, the instrument module runs before node:http is loaded, and a build with the option shows that order.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
@solidjs/vite-plugin 3.0.0-next.50, solid-js 2.0.0-rc.15, Node 26.
With start: { node: true, instrument: './src/instrumentation.ts' }, the emitted dist/server/node.js starts with static imports:
import { createServer } from 'node:http';
// …node:fs, node:path, node:stream/promises…
import { handleRequest } from './server.js';
./server.js is where the start.instrument wrapper runs (await import(instrument); await import(handler)). Static imports are evaluated first, so node:http is already loaded when the instrument module runs. OpenTelemetry's HTTP instrumentation (@opentelemetry/auto-instrumentations-node / instrumentation-http) then misses the server: there is no HTTP server span for any request. The same instrument module works when it is passed as node --import ./dist/instrumentation.js.
The option's docs say the module "runs to completion before anything else in the server graph loads" on every surface. For start.node the entry itself breaks that.
What we see: we run an instrument module that starts the OpenTelemetry NodeSDK, and serve through the node entry (createListener from dist/server/node.js). Run that way, the collector gets no HTTP SERVER span for any request. With the same module passed as node --import, every request gets one. The import order above is the reason as far as we can tell. We have not reduced it to a standalone repo.
Suggestion: when instrument is set, have the node entry await it before the node:* imports. One way is to emit await import(instrument) at the top of node.js and load the rest of the entry through a dynamic import. Another is to load node:http lazily inside serve / createListener.
We pass --import for now, so the option is unused in our apps.
- Linguagem predominante
- TypeScript
- Estrelas
- 522
- Forks
- 73
- Merge médio
- 1d 4h
- PRs com merge (30d)
- 35
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de solidjs/solid-vite-plugin
-
Test environment detection doesn't consider Vitest workspacesTalvez já em andamento @carloitaben assumiu há 57 dias. Aberta1.x
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
solidjs/solid-vite-plugin#205 · 1 comentário · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 58/100
solidjs/solid-vite-plugin#428 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 58/100
solidjs/solid-vite-plugin#427 ·
Mantenedores costumam responder em até 1 dia
-
Dev: a stylesheet shared by the entry and a lazy component moves after the lazy component's stylesAberta
Dificuldade 3/5 Meio dia Facilidade para iniciantes 62/100
solidjs/solid-vite-plugin#425 ·
Mantenedores costumam responder em até 1 dia
-
[3.0.0-next.50 / next] SSR build: the $$moduleUrl export added to a Worker main module stops workerd from startingTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 3/5 Meio dia Facilidade para iniciantes 55/100
solidjs/solid-vite-plugin#420 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de solidjs/solid-vite-plugin
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 65/100
521xueweihan/HelloGitHub#4025 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
voidzero-dev/void#478 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 69/100
Small-tailqwq/dsh-deep-whale#207 ·
Mantenedores costumam responder em até 1 dia
-
The inspector never shows the instances field, so scaling out is unreachableTalvez já em andamento @Mrkewl assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
xevrion/breakscale#96 ·
Mantenedores costumam responder em até 4 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Flux159/mcp-server-kubernetes#384 ·