server-info

Description

The server-info Plugin periodically reports basic server information to etcd.

The information reported by the Plugin is explained below:

NameTypeDescription
boot_timeintegerBootstrap time (UNIX timestamp) of the APISIX instance. Resets when hot updating but not when APISIX is just reloaded.
idstringAPISIX instance ID.
etcd_versionstringVersion of the etcd cluster used by APISIX. Will be unknown if the network to etcd is partitioned.
versionstringVersion of APISIX instance.
hostnamestringHostname of the machine/pod APISIX is deployed to.

Attributes

None.

API

This Plugin exposes the endpoint /v1/server_info to the Control API

Enable Plugin

Add server-info to the Plugin list in your configuration file (conf/config.yaml):

conf/config.yaml

  1. plugins:
  2. - ...
  3. - server-info

Customizing server info report configuration

We can change the report configurations in the plugin_attr section of conf/config.yaml.

The following configurations of the server info report can be customized:

NameTypeDefaultDescription
report_ttlinteger36Time in seconds after which the report is deleted from etcd (maximum: 86400, minimum: 3).

To customize, you can modify the plugin_attr attribute in your configuration file (conf/config.yaml):

conf/config.yaml

  1. plugin_attr:
  2. server-info:
  3. report_ttl: 60

Example usage

After you enable the Plugin as mentioned above, you can access the server info report through the Control API:

  1. curl http://127.0.0.1:9090/v1/server_info -s | jq .
  1. {
  2. "etcd_version": "3.5.0",
  3. "id": "b7ce1c5c-b1aa-4df7-888a-cbe403f3e948",
  4. "hostname": "fedora32",
  5. "version": "2.1",
  6. "boot_time": 1608522102
  7. }
server-info - 图1tip

You can also view the server info report through the APISIX Dashboard.

Delete Plugin

To remove the Plugin, you can remove server-info from the list of Plugins in your configuration file:

conf/config.yaml

  1. plugins:
  2. - ...