Datadog expects serverless-init
to be the top-level application, with the rest of your app’s command line passed in for serverless-init
to execute.
If you already have an entrypoint defined inside your Dockerfile, you can instead modify the CMD argument.
CMD ["/app/datadog-init", "/dd_tracer/python/bin/ddtrace-run", "python", "path/to/your/python/app.py"]
If you require your entrypoint to be instrumented as well, you can instead swap your entrypoint and CMD arguments.
ENTRYPOINT ["/app/datadog-init"]
CMD ["/your_entrypoint.sh", "/dd_tracer/python/bin/ddtrace-run", "python", "path/to/your/python/app.py"]
As long as your command to run is passed as an argument to datadog-init
, you will receive full instrumentation.