-
Notifications
You must be signed in to change notification settings - Fork 27.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instrumentation hook is not called in standalone
output
#49897
Comments
Works for me on
|
Thanks @tomsseisums, I can confirm that it runs when handling a request. When I read the documentation, I thought there is only one server instance. So is this expected behavior?
|
i have the same problem |
same problem as well |
I believe I'm also experiencing this. I use Only caveat to this is that I'm not sure that vercel deploys both respecting the |
Has anyone found any workaround for this? I've already tried canary version, no chance. |
This is still an issue. It seems that if you disable |
|
I'm having the same problem. |
Ran into the same problem with same behavior as @Aaqu reported. Using Next.js v13.5.4 Using workaround for now when using docker: RUN chmod +x ./start.sh
CMD ["./start.sh"] start.sh
|
This bug is also present in 14.0.1. Works fine with |
@jankaifer @sophiebits @feedthejim @huozhi instrumentation.js is missing in standalone mode even though #48615 was merged 😢 |
There seems to be a bug as the correct behavior should be (from the docs):
A simple workaround is to create some flag variable (or several) in instrumentation.ts and check if the
This way |
Hello everyone, I'd like to ask if you're experiencing this issue only in standalone mode. |
@aNyMoRe0505 I'm experiencing the same issue. I chose to start a Queue worker using the Everything works smoothly locally |
Any update on this? I'm experiencing the exact same issue. The only workaround is to not use the standalone export mode. |
vercel will not sell if standalone mode has implement properly... |
I've created a separate issue for those experiencing similar issues without |
I am using the latest version 14.0.5-canary.58 and am also facing this problem. The instrumentation call after assembly is not called when the server starts, but when the route is first called. In dev mode, as expected, instrumentation exits when the server starts. |
still same problem in |
instrumentation seems to work in Next.js 14.2.0-canary.44 🎉 more in #63536 next.config.mjs
src/app/api/boot/boot.ts
src/app/api/boot/route.ts
src/instrumentation.ts
*tested in docker with file |
You have a example? I test my example from instrumentation, work on Next.js 14.2.3 with docker |
It turned out that we had some issues with opentelemetry library. Your example worked for us. We can confirm that latest version is working with standalone output and instrumentation 🚀 |
We had the same problem on version |
I'm gonna close this as it seems to be mostly fixed. |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 Binaries: Node: 18.16.0 npm: 9.5.1 Yarn: 1.22.19 pnpm: 8.5.0 Relevant packages: next: 13.4.3-canary.1 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
Standalone mode (output: "standalone")
Link to the code that reproduces this issue
https://github.com/madebyherzblut/next-instrumentation-standalone
To Reproduce
create-next-app
instrumentationHook
andstandalone
output innext.config.js
next build
.next/standalone/server.js
Describe the Bug
The instrumentation hook is executed with
next dev
, but not instandalone
mode. Based on the example provided in #48262 I could trace the issue back to changes betweennext@13.3.5-canary.8
andnext@13.3.5-canary.9
. If the hook is called it should output "Instrumenting nodejs runtime" in the examples below:Expected Behavior
The instrumentation hook should be executed in
standalone
outputs.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: