You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/02 09:01:47 UTC

[GitHub] [apisix] tokers commented on a change in pull request #2926: feat: server info

tokers commented on a change in pull request #2926:
URL: https://github.com/apache/apisix/pull/2926#discussion_r533998634



##########
File path: doc/plugins/server-info.md
##########
@@ -0,0 +1,115 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+- [中文](../zh-cn/plugins/server-info.md)
+
+# Summary
+
+- [**Name**](#name)
+- [**Attributes**](#attributes)
+- [**API**](#api)
+- [**How To Enable**](#how-to-enable)
+- [**Test Plugin**](#test-plugin)
+- [**Disable Plugin**](#disable-plugin)
+
+## Name
+
+`server-info` is a plugin that reports basic server information to etcd periodically and allows us to get them in the data plane through it's API.
+
+## Attributes
+
+None
+
+## API
+
+This plugin now exposes only one API `/apisix/server_info` to get basic server information.
+You may need to use [interceptors](../plugin-interceptors.md) to protect it.
+
+
+## How to Enable
+
+Just configure `server-info` in the plugin list of the configuration file `conf/config.yaml`.
+
+```
+plugins:                          # plugin list
+  - example-plugin
+  - limit-req
+  - node-status
+  - server-info
+  - jwt-auth
+  - zipkin
+  ......
+```
+
+After starting APISIX and accessing `/apisix/server_info` then you can get server information.
+
+## How to customize the server info report interval
+
+We can change the report interval in the `plugin_attr` section of `conf/config.yaml`.
+
+| Name         | Type   | Default  | Description                                                          |
+| ------------ | ------ | -------- | -------------------------------------------------------------------- |
+| report_interval | number | 60 | the interval (unit: second) to report server info to etcd.              |
+
+Here is an example, which modifies the report interval to 10 seconds.
+
+```yaml
+plugin_attr:
+  server-info:
+    report_interval: 10
+```
+
+## Test Plugin
+
+```bash
+curl http://127.0.0.1:9080/apisix/admin/server_info -s | jq

Review comment:
       Fixed.




----------------------------------------------------------------
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:
users@infra.apache.org