Skip to content

Commit 0f392a6

Browse files
docs: clean up the dynamic modules logs docs (#42768)
## Description This PR addresses minor styling nits in the Dynamic Modules (Network/HTTP) docs. --- **Commit Message:** docs: clean up the dynamic modules logs docs **Additional Description:** Addresses minor styling nits in the Dynamic Modules (Network/HTTP) docs. **Risk Level:** N/A **Testing:** CI **Docs Changes:** N/A **Release Notes:** N/A --------- Signed-off-by: Rohit Agrawal <[email protected]> Co-authored-by: phlax <[email protected]> Mirrored from https://github.com/envoyproxy/envoy @ 98b0f479f50000c0daca5abcb006b1074323931c
1 parent c741076 commit 0f392a6

File tree

3 files changed

+120
-90
lines changed

3 files changed

+120
-90
lines changed

envoy/extensions/dynamic_modules/v3/dynamic_modules.proto

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,59 @@ option java_multiple_files = true;
1111
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/dynamic_modules/v3;dynamic_modulesv3";
1212
option (udpa.annotations.file_status).package_version_status = ACTIVE;
1313

14-
// [#protodoc-title: Dynamic Modules common configuration]
14+
// [#protodoc-title: Dynamic Modules Common Configuration]
1515

16-
// Configuration of a dynamic module. A dynamic module is a shared object file that can be loaded via dlopen
17-
// by various Envoy extension points. Currently, only HTTP filter (envoy.filters.http.dynamic_modules) is supported.
16+
// Configuration of a dynamic module. A dynamic module is a shared object file that can be loaded via
17+
// ``dlopen`` by various Envoy extension points.
1818
//
19-
// How a module is loaded is determined by the extension point that uses it. For example, the HTTP filter
20-
// loads the module with dlopen when Envoy receives a configuration that references the module at load time.
21-
// If loading the module fails, the configuration will be rejected.
19+
// How a module is loaded is determined by the extension point that uses it. For example, the HTTP
20+
// filter loads the module when Envoy receives a configuration that references the module. If loading
21+
// the module fails, the configuration will be rejected.
2222
//
23-
// Whether or not the shared object is the same is determined by the file path as well as the file's inode depending
24-
// on the platform. Notably, if the file path and the content of the file are the same, the shared object will be reused.
23+
// A module is uniquely identified by its file path and the file's inode, depending on the platform.
24+
// Notably, if the file path and the content of the file are the same, the shared object will be
25+
// reused.
2526
//
26-
// A module must be compatible with the ABI specified in :repo:`abi.h <source/extensions/dynamic_modules/abi.h>`.
27-
// Currently, compatibility is only guaranteed by an exact version match between the Envoy
28-
// codebase and the dynamic module SDKs. In the future, after the ABI is stabilized, we will revisit
29-
// this restriction and hopefully provide a wider compatibility guarantee. Until then, Envoy
30-
// checks the hash of the ABI header files to ensure that the dynamic modules are built against the
31-
// same version of the ABI.
27+
// A module must be compatible with the ABI specified in :repo:`abi.h
28+
// <source/extensions/dynamic_modules/abi.h>`. Currently, compatibility is only guaranteed by an
29+
// exact version match between the Envoy codebase and the dynamic module SDKs. In the future, after
30+
// the ABI is stabilized, this restriction will be revisited. Until then, Envoy checks the hash of
31+
// the ABI header files to ensure that the dynamic modules are built against the same version of the
32+
// ABI.
3233
message DynamicModuleConfig {
33-
// The name of the dynamic module. The client is expected to have some configuration indicating where to search for the module.
34-
// In Envoy, the search path can only be configured via the environment variable ``ENVOY_DYNAMIC_MODULES_SEARCH_PATH``.
35-
// The actual search path is ``${ENVOY_DYNAMIC_MODULES_SEARCH_PATH}/lib${name}.so``. TODO: make the search path configurable via
36-
// command line options.
34+
// The name of the dynamic module.
35+
//
36+
// The client is expected to have some configuration indicating where to search for the module. In
37+
// Envoy, the search path can only be configured via the environment variable
38+
// ``ENVOY_DYNAMIC_MODULES_SEARCH_PATH``. The actual search path is
39+
// ``${ENVOY_DYNAMIC_MODULES_SEARCH_PATH}/lib${name}.so``.
40+
//
41+
// .. note::
42+
// There is some remaining work to make the search path configurable via command line options.
3743
string name = 1 [(validate.rules).string = {min_len: 1}];
3844

39-
// Set true to prevent the module from being unloaded with dlclose.
40-
// This is useful for modules that have global state that should not be unloaded.
41-
// A module is closed when no more references to it exist in the process. For example,
42-
// no HTTP filters are using the module (e.g. after configuration update).
45+
// If true, prevents the module from being unloaded with ``dlclose``.
46+
//
47+
// This is useful for modules that have global state that should not be unloaded. A module is
48+
// closed when no more references to it exist in the process. For example, no HTTP filters are
49+
// using the module (e.g. after configuration update).
50+
//
51+
// Defaults to ``false``.
4352
bool do_not_close = 3;
4453

45-
// The dynamic module is loaded with ``RTLD_LOCAL`` flag to avoid symbol conflicts when multiple
46-
// modules are loaded by default. Set this to true to load the module with ``RTLD_GLOBAL`` flag.
47-
// This is useful for modules that need to share symbols with other dynamic libraries. For
48-
// example, a module X may load another shared library Y that depends on some symbols defined
49-
// in module X. In this case, module X must be loaded with ``RTLD_GLOBAL`` flag so that the
50-
// symbols defined in module X are visible to library Y.
54+
// If true, the dynamic module is loaded with the ``RTLD_GLOBAL`` flag.
55+
//
56+
// The dynamic module is loaded with the ``RTLD_LOCAL`` flag by default to avoid symbol conflicts
57+
// when multiple modules are loaded. Set this to ``true`` to load the module with the
58+
// ``RTLD_GLOBAL`` flag. This is useful for modules that need to share symbols with other dynamic
59+
// libraries. For example, a module X may load another shared library Y that depends on some
60+
// symbols defined in module X. In this case, module X must be loaded with the ``RTLD_GLOBAL``
61+
// flag so that the symbols defined in module X are visible to library Y.
5162
//
5263
// .. warning::
53-
// Use this option with caution as it may lead to symbol conflicts and undefined behavior
54-
// if multiple modules define the same symbols and are loaded globally.
64+
// Use this option with caution as it may lead to symbol conflicts and undefined behavior if
65+
// multiple modules define the same symbols and are loaded globally.
66+
//
67+
// Defaults to ``false``.
5568
bool load_globally = 4;
5669
}

envoy/extensions/filters/http/dynamic_modules/v3/dynamic_modules.proto

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,47 @@ option java_multiple_files = true;
1414
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/dynamic_modules/v3;dynamic_modulesv3";
1515
option (udpa.annotations.file_status).package_version_status = ACTIVE;
1616

17-
// [#protodoc-title: HTTP filter for dynamic modules]
17+
// [#protodoc-title: Dynamic Modules HTTP Filter]
1818
// [#extension: envoy.filters.http.dynamic_modules]
1919

20-
// Configuration of the HTTP filter for dynamic modules. This filter allows loading shared object files
21-
// that can be loaded via dlopen by the HTTP filter.
20+
// Configuration for the Dynamic Modules HTTP filter. This filter allows loading shared object files
21+
// that can be loaded via ``dlopen`` to extend the HTTP filter chain.
2222
//
23-
// A module can be loaded by multiple HTTP filters, hence the program can be structured in a way that
24-
// the module is loaded only once and shared across multiple filters providing multiple functionalities.
23+
// A module can be loaded by multiple HTTP filters; the module is loaded only once and shared across
24+
// multiple filters.
2525
//
26-
// A dynamic module HTTP filter can opt into being a terminal filter with no upstream by setting ``terminal_filter`` to
27-
// true in the configuration. A terminal dynamic module can use ``send_`` ABI methods to send response headers,
28-
// body and trailers to the downstream.
26+
// A dynamic module HTTP filter can opt into being a terminal filter with no upstream by setting
27+
// :ref:`terminal_filter
28+
// <envoy_v3_api_field_extensions.filters.http.dynamic_modules.v3.DynamicModuleFilter.terminal_filter>`
29+
// to ``true``. A terminal dynamic module can use ``send_`` ABI methods to send response headers,
30+
// body, and trailers to the downstream.
2931
message DynamicModuleFilter {
3032
// Specifies the shared-object level configuration.
3133
envoy.extensions.dynamic_modules.v3.DynamicModuleConfig dynamic_module_config = 1;
3234

33-
// The name for this filter configuration. This can be used to distinguish between different filter implementations
34-
// inside a dynamic module. For example, a module can have completely different filter implementations.
35-
// When Envoy receives this configuration, it passes the filter_name to the dynamic module's HTTP filter config init function
36-
// together with the filter_config.
37-
// That way a module can decide which in-module filter implementation to use based on the name at load time.
35+
// The name for this filter configuration.
36+
//
37+
// This can be used to distinguish between different filter implementations inside a dynamic
38+
// module. For example, a module can have completely different filter implementations. When Envoy
39+
// receives this configuration, it passes the ``filter_name`` to the dynamic module's HTTP filter
40+
// config init function together with the ``filter_config``. That way a module can decide which
41+
// in-module filter implementation to use based on the name at load time.
3842
string filter_name = 2;
3943

40-
// The configuration for the filter chosen by filter_name. This is passed to the module's HTTP filter initialization function.
41-
// Together with the filter_name, the module can decide which in-module filter implementation to use and
44+
// The configuration for the filter chosen by ``filter_name``.
45+
//
46+
// This is passed to the module's HTTP filter initialization function. Together with the
47+
// ``filter_name``, the module can decide which in-module filter implementation to use and
4248
// fine-tune the behavior of the filter.
4349
//
44-
// For example, if a module has two filter implementations, one for logging and one for header manipulation,
45-
// filter_name is used to choose either logging or header manipulation. The filter_config can be used to
46-
// configure the logging level or the header manipulation behavior.
50+
// For example, if a module has two filter implementations, one for logging and one for header
51+
// manipulation, ``filter_name`` is used to choose either logging or header manipulation. The
52+
// ``filter_config`` can be used to configure the logging level or the header manipulation
53+
// behavior.
4754
//
48-
// ``google.protobuf.Struct`` is serialized as JSON before
49-
// passing it to the plugin. ``google.protobuf.BytesValue`` and
50-
// ``google.protobuf.StringValue`` are passed directly without the wrapper.
55+
// ``google.protobuf.Struct`` is serialized as JSON before passing it to the plugin.
56+
// ``google.protobuf.BytesValue`` and ``google.protobuf.StringValue`` are passed directly without
57+
// the wrapper.
5158
//
5259
// .. code-block:: yaml
5360
//
@@ -63,35 +70,42 @@ message DynamicModuleFilter {
6370
//
6471
google.protobuf.Any filter_config = 3;
6572

66-
// Set true if the dynamic module is a terminal filter to use without an upstream.
73+
// If ``true``, the dynamic module is a terminal filter to use without an upstream.
74+
//
6775
// The dynamic module is responsible for creating and sending the response to downstream.
76+
//
77+
// Defaults to ``false``.
6878
bool terminal_filter = 4;
6979
}
7080

71-
// Configuration of the HTTP per-route filter for dynamic modules. This filter allows loading shared object files
72-
// that can be loaded via dlopen by the HTTP filter.
81+
// Configuration of the HTTP per-route filter for dynamic modules.
7382
message DynamicModuleFilterPerRoute {
7483
// Specifies the shared-object level configuration.
7584
envoy.extensions.dynamic_modules.v3.DynamicModuleConfig dynamic_module_config = 1;
7685

77-
// The name for this filter configuration. This can be used to distinguish between different filter implementations
78-
// inside a dynamic module. For example, a module can have completely different filter implementations.
79-
// When Envoy receives this configuration, it passes the filter_name to the dynamic module's HTTP per-route filter config init function
80-
// together with the filter_config.
81-
// That way a module can decide which in-module filter implementation to use based on the name at load time.
86+
// The name for this filter configuration.
87+
//
88+
// This can be used to distinguish between different filter implementations inside a dynamic
89+
// module. For example, a module can have completely different filter implementations. When Envoy
90+
// receives this configuration, it passes the ``per_route_config_name`` to the dynamic module's
91+
// HTTP per-route filter config init function together with the ``filter_config``. That way a
92+
// module can decide which in-module filter implementation to use based on the name at load time.
8293
string per_route_config_name = 2;
8394

84-
// The configuration for the filter chosen by filter_name. This is passed to the module's HTTP per-route filter initialization function.
85-
// Together with the filter_name, the module can decide which in-module filter implementation to use and
86-
// fine-tune the behavior of the filter on a specific route.
95+
// The configuration for the filter chosen by ``per_route_config_name``.
96+
//
97+
// This is passed to the module's HTTP per-route filter initialization function. Together with
98+
// the ``per_route_config_name``, the module can decide which in-module filter implementation to
99+
// use and fine-tune the behavior of the filter on a specific route.
87100
//
88-
// For example, if a module has two filter implementations, one for logging and one for header manipulation,
89-
// filter_name is used to choose either logging or header manipulation. The filter_config can be used to
90-
// configure the logging level or the header manipulation behavior.
101+
// For example, if a module has two filter implementations, one for logging and one for header
102+
// manipulation, ``per_route_config_name`` is used to choose either logging or header
103+
// manipulation. The ``filter_config`` can be used to configure the logging level or the header
104+
// manipulation behavior.
91105
//
92-
// ``google.protobuf.Struct`` is serialized as JSON before
93-
// passing it to the plugin. ``google.protobuf.BytesValue`` and
94-
// ``google.protobuf.StringValue`` are passed directly without the wrapper.
106+
// ``google.protobuf.Struct`` is serialized as JSON before passing it to the plugin.
107+
// ``google.protobuf.BytesValue`` and ``google.protobuf.StringValue`` are passed directly without
108+
// the wrapper.
95109
//
96110
// .. code-block:: yaml
97111
//

envoy/extensions/filters/network/dynamic_modules/v3/dynamic_modules.proto

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,43 @@ option java_multiple_files = true;
1414
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/dynamic_modules/v3;dynamic_modulesv3";
1515
option (udpa.annotations.file_status).package_version_status = ACTIVE;
1616

17-
// [#protodoc-title: Network filter for dynamic modules]
17+
// [#protodoc-title: Dynamic Modules Network Filter]
1818
// [#extension: envoy.filters.network.dynamic_modules]
1919

20-
// Configuration of the network filter for dynamic modules. This filter allows loading shared object
21-
// files that can be loaded via dlopen by the network filter.
20+
// Configuration for the Dynamic Modules network filter. This filter allows loading shared object
21+
// files that can be loaded via ``dlopen`` to extend the network filter chain.
2222
//
23-
// A module can be loaded by multiple network filters, hence the program can be structured in a way
24-
// that the module is loaded only once and shared across multiple filters providing multiple
25-
// functionalities.
23+
// A module can be loaded by multiple network filters; the module is loaded only once and shared
24+
// across multiple filters.
2625
//
27-
// Unlike HTTP filters which operate on structured headers, body, and trailers, network filters
28-
// work with raw TCP byte streams. The filter can:
26+
// Unlike HTTP filters which operate on structured headers, body, and trailers, network filters work
27+
// with raw TCP byte streams. The filter can:
2928
//
3029
// * Inspect, modify, or inject data into the downstream connection.
3130
// * Access connection-level information such as addresses and TLS status.
3231
// * Control connection lifecycle (e.g., close the connection).
33-
//
3432
message DynamicModuleNetworkFilter {
3533
// Specifies the shared-object level configuration.
3634
envoy.extensions.dynamic_modules.v3.DynamicModuleConfig dynamic_module_config = 1;
3735

38-
// The name for this filter configuration. This can be used to distinguish between different
39-
// filter implementations inside a dynamic module. For example, a module can have completely
40-
// different filter implementations. When Envoy receives this configuration, it passes the
41-
// ``filter_name`` to the dynamic module's network filter config init function together with
42-
// the ``filter_config``. That way a module can decide which in-module filter implementation
43-
// to use based on the name at load time.
36+
// The name for this filter configuration.
37+
//
38+
// This can be used to distinguish between different filter implementations inside a dynamic
39+
// module. For example, a module can have completely different filter implementations. When Envoy
40+
// receives this configuration, it passes the ``filter_name`` to the dynamic module's network
41+
// filter config init function together with the ``filter_config``. That way a module can decide
42+
// which in-module filter implementation to use based on the name at load time.
4443
string filter_name = 2;
4544

46-
// The configuration for the filter chosen by ``filter_name``. This is passed to the module's
47-
// network filter initialization function. Together with the ``filter_name``, the module can
48-
// decide which in-module filter implementation to use and fine-tune the behavior of the filter.
45+
// The configuration for the filter chosen by ``filter_name``.
46+
//
47+
// This is passed to the module's network filter initialization function. Together with the
48+
// ``filter_name``, the module can decide which in-module filter implementation to use and
49+
// fine-tune the behavior of the filter.
4950
//
5051
// For example, if a module has two filter implementations, one for echo and one for rate
51-
// limiting, ``filter_name`` is used to choose either echo or rate limiting. The ``filter_config``
52-
// can be used to configure the echo behavior or the rate limiting parameters.
52+
// limiting, ``filter_name`` is used to choose either echo or rate limiting. The
53+
// ``filter_config`` can be used to configure the echo behavior or the rate limiting parameters.
5354
//
5455
// ``google.protobuf.Struct`` is serialized as JSON before passing it to the module.
5556
// ``google.protobuf.BytesValue`` and ``google.protobuf.StringValue`` are passed directly
@@ -69,8 +70,10 @@ message DynamicModuleNetworkFilter {
6970
//
7071
google.protobuf.Any filter_config = 3;
7172

72-
// Set true if the dynamic module is a terminal filter to use without an upstream connection.
73+
// If ``true``, the dynamic module is a terminal filter to use without an upstream connection.
74+
//
7375
// The dynamic module is responsible for creating and sending the response to downstream.
74-
// If not specified, defaults to false.
76+
//
77+
// Defaults to ``false``.
7578
bool terminal_filter = 4;
7679
}

0 commit comments

Comments
 (0)