Troubleshooting Node.js App and API Protection
This product is not supported for your selected
Datadog site. (
).
Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel,
n'hésitez pas à nous contacter.
Common Issues
No security signals appearing
If you don’t see AAP threat information in the Trace and Signals Explorer for your Node.js application, follow these steps to troubleshoot the issue:
Verify Agent version:
- Ensure you’re running Datadog Agent v7.41.1 or higher.
- Check Agent status:
datadog-agent status
.
Check Node.js tracer version:
- Confirm you’re using Node.js tracer v4.30.0 or higher.
- Verify the tracer is loaded:
node -e "console.log(require('dd-trace/package.json').version)"
.
Verify environment variables:
- Ensure
DD_APPSEC_ENABLED=true
is set. - Check
DD_SERVICE
and DD_ENV
are properly configured. - Verify
DD_APM_ENABLED=true
if using APM features.
Check tracer initialization:
- Ensure
dd-trace/init
is required at the start of your application. - Verify the tracer is properly loaded before your application code.
Application fails to start
Check Node.js version compatibility:
Check dd-trace installation:
- Ensure
dd-trace
is properly installed: npm list dd-trace
. - Reinstall if necessary:
npm install dd-trace
.
Module loading errors:
- Check for conflicts with other tracing libraries.
- Verify the tracer is required before other modules.
High latency:
- Check Agent resource usage.
- Verify network connectivity between Agent and Datadog.
- Consider adjusting sampling rates.
- Review performance considerations.
High memory usage:
- Monitor Node.js process memory usage.
- Check for memory leaks in your application.
- Consider adjusting tracer configuration.
Configuration issues
Environment variables not recognized:
- Ensure environment variables are set before starting the application.
- Check for typos in environment variable names.
- Verify that the tracer is initialized with the correct configuration.
Tracer initialization problems:
- Make sure
require('dd-trace/init')
is the first line in your application. - Check for syntax errors in your tracer configuration.
- Verify that the tracer is being imported correctly.
Still having issues?
If you’re still experiencing problems:
- Check the Application Security Monitoring troubleshooting guide.
- Review the Node.js tracer documentation.
- Enable debug logging:
DD_TRACE_DEBUG=true
. - Contact Datadog support.