Troubleshooting Python App and API Protection
This product is not supported for your selected
Datadog site. (
).
Common Issues
No security signals appearing
Verify Agent version
- Ensure you’re running Datadog Agent v7.41.1 or higher
- Check Agent status:
datadog-agent status
Check Python tracer version
- Confirm you’re using Python tracer v2.21 or a recent version on v3.0.0
- Check version:
python -c "import ddtrace; print(ddtrace.__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
Application fails to start
Check ddtrace installation
- Verify ddtrace is installed:
pip show ddtrace
- Install with security extras:
pip install ddtrace
Import errors
- Ensure all required dependencies are installed
- Check for conflicting packages
Environment variable issues
- Verify environment variables are set correctly
- Check for typos in variable names
Service not identified
Symptoms: Service appears as “unnamed-service” in Datadog
Solution: Set the DD_SERVICE
environment variable:
export DD_SERVICE=your-service-name
export DD_ENV=your-environment
ddtrace-run python app.py
Permission issues
Symptoms: Application fails to start or AAP doesn’t work
Solution: Ensure proper file permissions and that the application can write to /tmp
:
chmod 755 /path/to/your/app
Framework not supported
Symptoms: AAP works but some features are missing
Solution: Check the compatibility guide for supported frameworks and versions.
Debug Mode
Enable debug logging to get more information:
export DD_TRACE_DEBUG=true
export DD_APPSEC_ENABLED=true
ddtrace-run python app.py
Still having issues?
If you’re still experiencing problems:
- Check the Application Security Monitoring troubleshooting guide
- Review the Python tracer documentation
- Contact Datadog support
Further Reading
Additional helpful documentation, links, and articles: