Plugin Metadata
Understand the concept of plugin metadata in Apache APISIX, which manages shared configurations for plugins, ensuring consistency across multiple instances.
Overview
In APISIX, a plugin metadata object configures the common metadata field(s) of all plugin instances sharing the same plugin name. Use it when a plugin is enabled across multiple objects and their metadata fields have to be updated together.
The following diagram illustrates the concept of plugin metadata using two instances of syslog (opens in Plugin Hub docs) plugins on two different routes, as well as a plugin metadata object setting a global log_format for the syslog plugin:
Unless otherwise specified, the log_format on plugin metadata object should apply the same log format uniformly to both syslog plugins. However, since the syslog plugin on the /order route has a different log_format, requests visiting this route will generate logs in the log_format specified by the plugin on the route.
In general, if a field of a plugin is defined in both the plugin metadata and another object, such as a route, the definition on the other object takes precedence over the global definition in plugin metadata to provide a more granular level of control.
Use a plugin metadata object only for a plugin that has metadata fields. To see which plugins have metadata fields, see the Plugin Hub (opens in Plugin Hub docs).
Related
Tasks that use this concept
Related concepts
- Key Concepts - Plugins
- Control API - Plugin Metadata
- Admin API - Plugin Metadata
- Plugin Hub (opens in Plugin Hub docs)