Skip to content

get python agent to record by default #166

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

Closed
symwell opened this issue Sep 19, 2022 · 1 comment · Fixed by #176
Closed

get python agent to record by default #166

symwell opened this issue Sep 19, 2022 · 1 comment · Fixed by #176
Assignees

Comments

@symwell
Copy link
Contributor

symwell commented Sep 19, 2022

Similar pr in appmap-ruby getappmap/appmap-ruby#281

Looked at Django and Flask, there are notes
Starting here - https://applanding.slack.com/archives/CQ5JFE1DY/p1663189579942259

About dev / test / prod in Django - https://stackoverflow.com/questions/10664244/django-how-to-manage-development-and-production-settings - tldr it's not really a standardized env var like rails.

Flask has ENV, DEBUG, TESTING and some other stuff - https://flask.palletsprojects.com/en/2.2.x/config/
app.config[“APPMAP”] might be the best option
Configuration is expected to be these flags on the app and then the code acts accordingly
So in other words it may be more idiomatic to check app.config rather than the environment
It's up to the developers to set those flags using whatever scheme they choose

@brikelly brikelly assigned symwell and unassigned symwell Sep 19, 2022
@symwell symwell self-assigned this Sep 26, 2022
@apotterri
Copy link
Contributor

Discussion about this here: https://applanding.slack.com/archives/CQ5JFE1DY/p1664381082288939

Going forward, I think we would like to support two ways of enabling AppMap for Django (
@Alan
 correct me if I’m wrong) (edited) 
1) APPMAP=true - enables all the recordings
2) Using Django “settings” - if the user loads a settings file that contains something like AppMap = True then AppMap will be enabled, unless APPMAP=false. (edited) 
This would be pretty consistent with Rails, where request + remote recording is auto-enabled in development, unless APPMAP=false, and test cases recording is auto-enabled in test, unless APPMAP=false
An individual env var is also available to enable/disable each recording method, like APPMAP_RECORD_RSPEC=(true|false)
This is not really for normal usage though
It’s all documented on the AppMap doc site for appmap-ruby, so check that and see if anything is missing and/or unclear
The main point is, using settings files seems to be idiomatic for Python, so we can support that. According to Alan, using env vars is also fairly common, so we support that too.
Ideally, we’d like developers to put AppMap = True in their development and test settings so it’s just on all the time. (edited)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants