Skip to main content

inspect

Enables dynamic Lua inspection on the engine, for debugging.

Category GeneralAdd it to Route, Service, Consumer, Consumer group, Global rule, Plugin configEngine plugin inspectPriority 200

What it does​

inspect turns on inspection of the gateway's own Lua code while it runs, for debugging the gateway itself. It has no settings of its own, only the five shared ones, so the console draws no form for it and it is added in the Raw JSON tab.

The hooks it runs come from a file named in the gateway's static configuration, not from the route. Adding the plugin to a route changes nothing a request or an answer shows.

When to use it​

  • Whoever runs the gateway nodes is tracing a fault in the gateway itself and has written hooks into the file its static configuration names.
  • A support case where the gateway's own code must be watched on a node while requests pass.
  • A test environment where the gateway is being debugged, away from the routes your clients call.

Not for running code of your own on the requests of a route — see serverless-pre-function (Runs Lua functions before the other plugins of a phase), trying out how a plugin is added and saved — see example-plugin (Example plugin of the engine's source tree) or making a route fail or slow on purpose — see fault-injection (Injects delays or fixed responses for testing).

Set it up​

Add the plugin to a route​

Adding it changes nothing on the route: the hooks run from the file the gateway's static configuration names, for every request on the node.

inspect · as the console saves it
{}

Things to know​

  • It serves debugging: it enables inspection of the gateway's own Lua code while it runs.
  • A setting the plugin does not carry is refused when you save. Only the five shared settings apply.
  • AdviceAdd it only when whoever runs the gateway nodes asks for it, and take it off once the fault is found.

Edited as Raw JSON​

This plugin has no settings of its own: only the five shared settings apply. The hooks it runs come from a file named in the gateway's static configuration.

Every plugin also has Enabled, Priority, Filter, Error response and Pre-function: see Plugin execution settings.

G8 dev · Apache APISIX® 3.19.0
Apache, Apache APISIX and APISIX are trademarks of The Apache Software Foundation.
Facts
Category
General
Add it to
Route, Service, Consumer, Consumer group, Global rule, Plugin config
Engine plugin
inspect
Priority
200