docs/root/configuration/other_features/bootstrap_extensions/dynamic_modules.rst
.. _config_bootstrap_extensions_dynamic_modules:
v3 API reference <envoy_v3_api_msg_extensions.bootstrap.dynamic_modules.v3.DynamicModuleBootstrapExtension>The Dynamic Modules bootstrap extension allows you to write bootstrap extensions in a dynamic module. This can be used to implement:
The extension is configured using the :ref:DynamicModuleBootstrapExtension <envoy_v3_api_msg_extensions.bootstrap.dynamic_modules.v3.DynamicModuleBootstrapExtension> message.
.. code-block:: yaml
bootstrap_extensions:
Bootstrap extensions have two lifecycle hooks:
onServerInitialized Called when the server is fully initialized, on the main thread. This is where you can:
onWorkerThreadInitialized Called once per worker thread when it starts. This is where you can:
Dynamic Configuration Loading
Use the onServerInitialized hook to fetch configuration from an external service (e.g., a config server)
at startup. Store the configuration in shared state that filters can access.
Singleton Pattern Implement a singleton that is initialized once and shared across all filters. For example, a connection pool to an external service, or a cache that is shared across all requests.
Global Metrics
Initialize custom metrics in the onServerInitialized hook that can be updated by filters throughout
the request lifecycle.
For more details on dynamic modules, see the :ref:architecture overview <arch_overview_dynamic_modules>.