-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add boolean config options #28
Conversation
✔️ All good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If active
is false, should we not avoid attempting to start the agent (over at agent.py
)? That is what the Node.js integration does (s/agent/extension)
|
||
|
||
DEFAULT_CONFIG = Options( | ||
enable_host_metrics=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the default config include active=True
as well? Otherwise users always have to specify it. Ruby derives it from whether push_api_key
is non-empty.
enable_host_metrics=True, | |
active=True, | |
enable_host_metrics=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Ruby you also need to set it in the YAML file and Ruby code. The Push API key only sets it to true if its set through APPSIGNAL_PUSH_API_KEY. This way people can set it based on the env as well with something like: active=(os.environ.get("foo") == "true")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But people can do that anyway, right? The default will be overriden with whatever users decide to set... Perhaps the default should be false
, then, like in the other integrations. Whatever makes sense. We'll need to amend the config in the test setup, though: https://github.com/appsignal/test-setups/blob/main/python/django4-celery/app/appsignal_config.py#L4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured I'd implement it the same way as the other integrations. We can always discuss behavior changes (please create an issue), but let's keep it like this for this PR.
Add config options that are booleans and should be interpreted as such.
1b5a4e8
to
95dfe81
Compare
I've added another commit with this check for the active option. |
6770587
to
df3d1a5
Compare
6c9c504
to
dafe175
Compare
Ignore the start call if the config isn't set to active. In the test I deliberately used an invalid config, so the agent will exit automatically once started.
dafe175
to
44210ce
Compare
Add config options that are booleans and should be interpreted as such.
Part of #16
[skip changeset]