Skip to main content
Version: 2.4

node-status

Summary#

Name#

node-status is a plugin which we could get request status information through it's API.

Attributes#

None

API#

This plugin will add /apisix/status to get status information. You may need to use interceptors to protect it.

How To Enable#

  1. Configure node-status in the plugin list of the configuration file conf/config.yaml, then you can add this plugin in any route.
plugins:                          # plugin list  - example-plugin  - limit-req  - node-status  - jwt-auth  - zipkin  ......

After starting APISIX, you can get status information through the API /apisix/status.

  1. Create a route object, and enable plugin node-status.
$ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '{    "uri": "/route1",    "upstream": {        "type": "roundrobin",        "nodes": {            "192.168.1.100:80:": 1        }    },    "plugins": {        "node-status":{}    }}'

You have to configure node-status in the configuration file apisix/conf/config.yaml before creating a route like this. And this plugin will not make any difference in future requests, so usually we don't set this plugin when creating routes.

Test Plugin#

  1. Request with uri /apisix/status
$ curl localhost:9080/apisix/status -iHTTP/1.1 200 OKDate: Tue, 03 Nov 2020 11:12:55 GMTContent-Type: text/plain; charset=utf-8Transfer-Encoding: chunkedConnection: keep-aliveServer: APISIX web server
{"status":{"total":"23","waiting":"0","accepted":"22","writing":"1","handled":"22","active":"1","reading":"0"},"id":"6790a064-8f61-44ba-a6d3-5df42f2b1bb3"}
  1. Parameter Description
ParameterDescription
statusstatus information
totalthe total number of client requests
waitingthe current number of idle client connections waiting for a request
acceptedthe total number of accepted client connections
writingthe current number of connections where APISIX is writing the response back to the client
handledthe total number of handled connections. Generally, the parameter value is the same as accepted unless some resource limits have been reached
activethe current number of active client connections including waiting connections
readingthe current number of connections where APISIX is reading the request header
idAPISIX's uid which is saved in apisix/conf/apisix.uid

Disable Plugin#

  1. You can delete node-status in the plugin list of the configuration file apisix/conf/config.yaml, then you can not add this plugin in any route.
plugins:                          # plugin list  - example-plugin  - limit-req  - jwt-auth  - zipkin  ......
  1. When you want to disable the node-status plugin in the route, it is very simple, you can delete the corresponding json configuration in the plugin configuration, no need to restart the service, it will take effect immediately.
$ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '{    "uri": "/route1",    "upstream": {        "type": "roundrobin",        "nodes": {            "192.168.1.100:80": 1        }    },    "plugins": {}}'