Gary-Airwallex opened a new issue #2711: URL: https://github.com/apache/apisix/issues/2711
### Issue description Plugins in global rules are prioritized over those in routes, regardless of priority. Our use case: prometheus configured in global rules & a custom plugin that is configured per route. The custom plugin sets a variable in context during log phase: `ctx.custom_variable = value`, and we'd like to get that variable in metrics, by modifying exporter.lua. However since global rules are always ran first we can't achieve that. One workaround I can think of is to move the `ctx.custom_variable = value` to an earlier phase. But since that part of the logic is dedicated for logging & monitoring, I don't think that's the best practice. It's more intuitive if the global rules respect plugin priorities. ### Environment * apisix version (cmd: `apisix version`): APISIX 2.0 * OS: mac/linux ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
