-
Notifications
You must be signed in to change notification settings - Fork 131
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 enabled config option replacing active #762
Conversation
[float] | ||
[[config-enabled]] | ||
==== `enabled` | ||
[options="header"] |
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.
This is a dynamic config, right? If so, let's add a dynamic
badge like we've done for the other settings: #760
[options="header"] | |
<<dynamic-configuration, image:./images/dynamic-config.svg[] >> | |
[options="header"] |
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.
No, only recording
is dynamic.
It says here about the enabled
configuration:
This can only be set locally to the agent (e.g. in code, config file, environment variable), and is interpreted once at agent initialisation time; once disabled, disabled for the process's lifetime.
…release * upstream/master: (24 commits) Ensure that a new central config fetch is scheduled after network error (elastic#772) Updates to Resque support and documentation (elastic#768) Support recording config option (elastic#765) Add tests and adjustments to classes that can be restarted (elastic#766) Ensure that the running agent's config is used when restarted (elastic#763) The enabled tag is config-enabled Add enabled config option replacing active (elastic#762) docs: add dynamic badge (elastic#760) Config values set to false should be false, not nil (elastic#761) Add changelog entry for updating log level on config's logger Add changelog entry for logging updated remote config values Add changelog entry for dynamic config values Check if env variable exists before setting up SimpleCov (elastic#759) Log the updated options from central config in addition to cumulative modifications (elastic#758) ci(jenkins): merge branch in downstream jobs (elastic#757) Log level on logger is updated when Config options are (elastic#755) Cobertura coverage (elastic#736) Allow Config values to be dynamic (elastic#747) Reorder checks in test in case values are being cleared before checked (elastic#743) ci(jenkins): disable stages for only docs (elastic#745) ...
Will Was thinking it'd be nice to make it dynamic based on the presence of the token & url env vars. |
According to the definitions here only the |
As mentioned in Safecast/safecastapi#670 (comment) having the gem installed without env vars set (eg., for local dev) led to a lot of log noise. My idea was to have it always installed and in the gemfile but only active if we provide the keys (as we do in deployed envs) |
I guess we could also move the gem to a production group in the gemfile. Any idea on what’s “usual”? For new relic we have it available and the token is configured via env var. if that’s nil the newrelic gem doesn’t log any errors. The we can set the key in deployed envs to get reporting. Would be nice to have a similar flow with elastic apm. |
It sounds like what you've proposed-- putting the gem in the Alternatively, you could set the elastic apm log level to |
Hi @matschaffer I just realized that maybe you were asking to change the config.enabled = false or were you looking to change the |
I'm not clear on where agent start happens in the rails lifecycle, but I don't need to switch it dynamically. It'll be either on or off for the life of the process. I ended up doing Safecast/safecastapi#677 which uses the gemfile in order to avoid using what appears to be a deprecated config setter. https://github.com/Safecast/safecastapi/pull/677/files#diff-b1fe55db50c712fef0673345e5b9c0d9L13 |
Fwiw, the configuration was a little surprising/confusing compared to newrelic. With newrelic all the config is always in place (I think it even provides a dev view though I don't use it much). But data is only sent if I was trying to figure out how to do something like that with elastic APM (only sending data if Though now that I type that maybe Update: Okay, after digging into the config loading a bit (especially https://github.com/elastic/apm-agent-ruby/blob/master/lib/elastic_apm/railtie.rb#L25-L36) I can see that Probably fine for now, just more of my own confusion about how to get the gem configured in a way that's nice for both prod & dev. |
yes, Thanks for the feedback regarding comparison between new relic and elastic APM. I do think, however, the best and simplest solution is what you've gone with-- using the groups in the Gemfile as there is no point in loading the gem if it is not intended to be used. |
Agreed. Thanks for helping get me pointed in a good direction. |
Deprecate the
active
config option and replace it withenabled
.#623