Skip to content
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

Support dynamic configuration without restarts #52756

Closed
2 tasks
joshdover opened this issue Dec 11, 2019 · 3 comments · Fixed by #98455
Closed
2 tasks

Support dynamic configuration without restarts #52756

joshdover opened this issue Dec 11, 2019 · 3 comments · Fixed by #98455
Labels
enhancement New value added to drive a business result Feature:New Platform NeededFor:Cloud Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@joshdover
Copy link
Contributor

joshdover commented Dec 11, 2019

The Kibana Platform supports watching config files for changes, and then propagating those config changes to Core and Plugins via an observable. The basic plumbing is already in place.

Currently, we only formally support changing the logging configuration at runtime. This is issue is to discuss other configurations we may want to also support changing at runtime without a restart.

While some configurations will be as simple as listening to the config observable and updating accordingly, other configurations (such as enabling and disabling plugins without restarts) will require more work in Core to support.

Please add config keys that need to be able to dynamically change without restarts of the Kibana server here and the Platform team will make sure these get delegated to the proper teams:

  • xpack.cloud.apm.url / xpack.cloud.apm.secret_token: they would allow us introduce changes on Cloud and cut quite a bit the time it takes to fully initialize a deployment with APM.
  • xpack.security.audit.*: Allow audit logging to be configured/updated at runtime. ES already supports this, so we should too!
@joshdover joshdover added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform enhancement New value added to drive a business result labels Dec 11, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@joshdover joshdover added this to 7.9 - Tentative in kibana-core [DEPRECATED] Mar 18, 2020
@joshdover joshdover moved this from 7.9 - Tentative to 7.10 (tentative) in kibana-core [DEPRECATED] Apr 22, 2020
@joshdover joshdover moved this from 7.10 - Tentative to 7.12 - Tentative in kibana-core [DEPRECATED] Apr 26, 2020
@joshdover joshdover moved this from 7.12 - Tentative to 8.0 - Tentative in kibana-core [DEPRECATED] Apr 26, 2020
@joshdover joshdover moved this from 8.0 - Tentative to Prioritized Backlog in kibana-core [DEPRECATED] Dec 2, 2020
@kobelb
Copy link
Contributor

kobelb commented Jan 25, 2021

/cc @ruflin, as we were talking about whether or not it's possible for Kibana to dynamically reload configuration values from the kibana.yml the other day.

@joshdover
Copy link
Contributor Author

To my surprise, I learned that the existing implementation of config reloading used for logging configuration actually works for all configuration values at the Core API level today.

Any config changes in the kibana.yml (or other config file specified with -c or --config) will be updated by Core and exposed to plugins via the PluginInitializer.config.create() API whenever a SIGHUP signal is received by the main Kibana process. In order to actually support this in the product, plugins need to be sure to subscribe to changes to their config and update any necessary state accordingly.

We could however improve the ergonomics of this feature by actually watching for file changes on the configuration file(s) so that it's not required for orchestrators to send the SIGHUP signal at all. Further research would need to be done on whether or not this would be desirable, is typical of other server-side software, or should be enabled by default.

Any plugins that take advantage of this feature should ideally be testing that it works end-to-end via a functional test before documenting this as supported feature in our public documentation. If/when plugins start adopting this feature, we should also standardize on a way to indicate that a config supports hot-reloads in our documentation.

I would like to note that the log messages from Core (well, actually CLI) are misleading since they only mention "logging configuration":

  log   [19:14:01.239] [info][config][cli] Reloading logging configuration due to SIGHUP.
  log   [19:14:01.246] [info][config][cli] Reloaded logging configuration due to SIGHUP.

Since the primary ask of this issue is already supported from Core, I think we should opt to fix the log message and then close this issue. Further improvements can be considered as separate issues; and only if they come up as a request from users or our Cloud team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:New Platform NeededFor:Cloud Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
Development

Successfully merging a pull request may close this issue.

3 participants