Repository: next.js
Issue: instrumentation.ts runtime showing as "edge" even when default runtime is supposed to be "nodejs" in local
Labels: bug,Runtime,Instrumentation

[Link to the code that reproduces this issue](https://codesandbox.io/p/devbox/vercel-next-js-reproduction-template-go8s7s?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clsamj2sy00063b6jzsic89yv%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clsamj2sy00023b6jsk5djepu%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clsamj2sy00043b6j36favbwc%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clsamj2sy00053b6jwhgd0wfc%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clsamj2sy00023b6jsk5djepu%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clsamj2sx00013b6j3e17s2ma%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252FREADME.md%2522%257D%255D%252C%2522id%2522%253A%2522clsamj2sy00023b6jsk5djepu%2522%252C%2522activeTabId%2522%253A%2522clsamj2sx00013b6j3e17s2ma%2522%257D%252C%2522clsamj2sy00053b6jwhgd0wfc%2522%253A%257B%2522tabs%2522%253A%255B%255D%252C%2522id%2522%253A%2522clsamj2sy00053b6jwhgd0wfc%2522%257D%252C%2522clsamj2sy00043b6j36favbwc%2522%253A%257B%2522id%2522%253A%2522clsamj2sy00043b6j36favbwc%2522%252C%2522tabs%2522%253A%255B%255D%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D)

### To Reproduce

1. Create an instrumentation.ts file
2. Above register(), add console.log("instrumentation runtime", process.env.NEXT_RUNTIME);


### Current vs. Expected behavior

Current behaviour:
console shows: `instrumentation runtime edge`

Expected behaviour: 
console shows: `instrumentation runtime nodejs`

I would assume that the default runtime (nodejs) would be used if not specified, [as shown in the docs](https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#segment-runtime-option)

I had to add `export const runtime ='nodejs'` to force the instrumentation.ts file to run in the nodejs environment (Edit: this does not work, see below for more context)



### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 23.1.0: Mon Oct  9 21:27:27 PDT 2023; root:xnu-10002.41.9~6/RELEASE_X86_64
Binaries:
  Node: 18.19.0
  npm: 10.2.3
  Yarn: 1.22.18
  pnpm: 8.11.0
Relevant Packages:
  next: 14.0.4
  eslint-config-next: 14.0.4
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Middleware / Edge (API routes, runtime)

### Which stage(s) are affected? (Select all that apply)

next dev (local)

### Additional context

I just realised what the issue is: 

- instrumentation.ts runs in the nodejs env when the server is first started, e.g. npm run dev
- When you make a change to the instrumentation.ts file, the server runs instrumentation.ts again, but in the edge env

Is this expected behaviour?