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

[BUG] Instrument NodeJs App in Azure App Services with serverless-init causes Cannot find module 'dd-trace/init' #33581

Open
chanep opened this issue Jan 30, 2025 · 0 comments

Comments

@chanep
Copy link

chanep commented Jan 30, 2025

Following the instructions for
Instrument Azure App Service with serverless-init - Linux Containers
in https://docs.datadoghq.com/serverless/guide/azure_app_service_linux_containers_serverless_init/
for an NodeJs app does not work

Agent Environment
NodeJs in Azure App Service with serverless-init - Linux Containers

Describe what happened:
When the container starts fails with
Error: Cannot find module 'dd-trace/init'

The Dockerfile in the documentation is wrong

COPY --from=datadog/serverless-init:1 /datadog-init /app/datadog-init
RUN npm install --prefix /dd_tracer/node dd-trace  --save
ENV DD_SERVICE=datadog-demo-run-nodejs
ENV DD_ENV=datadog-demo
ENV DD_VERSION=1
ENTRYPOINT ["/app/datadog-init"]
CMD ["/nodejs/bin/node", "/path/to/your/app.js"]

this
RUN npm install --prefix /dd_tracer/node dd-trace --save
does not install dd-trace in the folder /app/datadog-init expects

/app/datadog-init tries to load a module in /dd_tracer/node that actually got installed in /dd_tracer/node/node_modules

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