简体   繁体   中英

How to include command when executing python entry-point command in AWS Elasticbeanstalk?

I am deploying my flask application in AWS Elasticbeanstalk and I want to add a command for running datadog tracing when executing entry-point command. How can I do that?

This is the entry-point command to start my flask app in local machine:

python3 application.py

This is how to add a command before that entry-point command (using datadog as example):

ddtrace-run python3 application.py

How to do the same in AWS elasticbeanstalk? Seems like beanstalk is using apache + mod_wsgi to run python-flask application but I am not sure how to add a command before the entry-point command.

You can run datadog tracing on AWS Elastic Beanstalk with Flask by configure tracing manually as defined here :

from ddtrace import patch_all
patch_all()

from flask import Flask

app = Flask(__name__)


@app.route('/')
def index():
    return 'hello world'


if __name__ == '__main__':
    app.run()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM