Skip to content
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

[auto-instrumentations-node] - nextjs standalone mode does not include auto-instrumentations-node dependency #2519

Open
markmacumber opened this issue Nov 7, 2024 · 0 comments

Comments

@markmacumber
Copy link

Hello eveyone,

I have been trying to setup some instrumentation on my nextjs web app and have been following the documentation on the Grafana website: https://grafana.com/docs/grafana-cloud/monitor-applications/application-observability/instrument/node/

I have installed the packages (api and auto-instrumentations-node) - setup the ENV varaibles, and then tried to build and package my application for deployment.

However, my build command for nextjs runs in 'standalone' mode (https://nextjs.org/docs/pages/api-reference/next-config-js/output#automatically-copying-traced-files) so it can be packaged and deployed into my cloud environment.

The issue is that the node_modules do not include the above packages, so the command --require @opentelemetry/auto-instrumentations-node/register fails with the missing dependency.

I realise that the point of the auto-instrumentations-node library is to instrument without code changes (which is my desire), but how can I ensure that these packages are installed with the build?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant