[GitHub] [apisix] membphis commented on pull request #2023: feature: divide config.yaml into two files config-custom.yaml & confi…

2020-08-15 Thread GitBox


membphis commented on pull request #2023:
URL: https://github.com/apache/apisix/pull/2023#issuecomment-674468242


   > this pr is still a draft now ?
   
   missing doc. I'll add this later. but this feature is ready.



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




[GitHub] [apisix] membphis edited a comment on issue #2051: request help: what is the recommended way to split access log in k8s pod? for example, split by day

2020-08-15 Thread GitBox


membphis edited a comment on issue #2051:
URL: https://github.com/apache/apisix/issues/2051#issuecomment-673992843


   > for example, split by day
   
   Here is an example for `access` log, is right?
   
   ```
   access.log
   access-20200801-00.log
   access-20200802-00.log
   access-20200803-00.log
   ```
   yes you are right



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




[apisix] branch master updated: feat(prometheus): add prometheus metrics `node_info`(hostname) (#2063)

2020-08-15 Thread membphis
This is an automated email from the ASF dual-hosted git repository.

membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 7525f1f  feat(prometheus): add prometheus metrics 
`node_info`(hostname)  (#2063)
7525f1f is described below

commit 7525f1fcc93de1d9dd4767124359198eb053177a
Author: nic-chen <33000667+nic-c...@users.noreply.github.com>
AuthorDate: Sun Aug 16 09:59:55 2020 +0800

feat(prometheus): add prometheus metrics `node_info`(hostname)  (#2063)

* using a new metric `node_info` to store the hostname
---
 apisix/plugins/prometheus/exporter.lua | 10 ++
 t/plugin/prometheus.t  | 10 ++
 2 files changed, 20 insertions(+)

diff --git a/apisix/plugins/prometheus/exporter.lua 
b/apisix/plugins/prometheus/exporter.lua
index 8e6d74d..82ccf45 100644
--- a/apisix/plugins/prometheus/exporter.lua
+++ b/apisix/plugins/prometheus/exporter.lua
@@ -78,6 +78,11 @@ function _M.init()
 metrics.etcd_reachable = prometheus:gauge("etcd_reachable",
 "Config server etcd reachable from APISIX, 0 is unreachable")
 
+
+metrics.node_info = prometheus:gauge("node_info",
+"Info of APISIX node",
+{"hostname"})
+
 metrics.etcd_modify_indexes = prometheus:gauge("etcd_modify_indexes",
 "Etcd modify index for APISIX keys",
 {"key"})
@@ -98,6 +103,7 @@ function _M.init()
 metrics.bandwidth = prometheus:counter("bandwidth",
 "Total bandwidth in bytes consumed per service in APISIX",
 {"type", "route", "service", "node"})
+
 end
 
 
@@ -265,6 +271,8 @@ function _M.collect()
 etcd_modify_index()
 
 -- config server status
+local vars = ngx.var or {}
+local hostname = vars.hostname or ""
 local config = core.config.new()
 local version, err = config:server_version()
 if version then
@@ -276,6 +284,8 @@ function _M.collect()
"processing metrics endpoint: ", err)
 end
 
+metrics.node_info:set(1, gen_arr(hostname))
+
 local res, _ = config:getkey("/routes")
 if res and res.headers then
 clear_tab(key_values)
diff --git a/t/plugin/prometheus.t b/t/plugin/prometheus.t
index 3a7d5c7..9a43def 100644
--- a/t/plugin/prometheus.t
+++ b/t/plugin/prometheus.t
@@ -773,3 +773,13 @@ GET /apisix/prometheus/metrics
 qr/apisix_etcd_modify_indexes\{key="x_etcd_index"\} \d+/
 --- no_error_log
 [error]
+
+
+
+=== TEST 43: fetch the prometheus metric data -- hostname
+--- request
+GET /apisix/prometheus/metrics
+--- response_body eval
+qr/apisix_node_info\{hostname=".*"\} 1/
+--- no_error_log
+[error]



[GitHub] [apisix] membphis merged pull request #2063: change: add prometheus metrics `node_info`(hostname)

2020-08-15 Thread GitBox


membphis merged pull request #2063:
URL: https://github.com/apache/apisix/pull/2063


   



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




[GitHub] [apisix] nic-chen commented on pull request #2023: feature: divide config.yaml into two files config-custom.yaml & confi…

2020-08-15 Thread GitBox


nic-chen commented on pull request #2023:
URL: https://github.com/apache/apisix/pull/2023#issuecomment-674457540


   this pr is still a draft now..



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




[GitHub] [apisix] nic-chen edited a comment on pull request #2023: feature: divide config.yaml into two files config-custom.yaml & confi…

2020-08-15 Thread GitBox


nic-chen edited a comment on pull request #2023:
URL: https://github.com/apache/apisix/pull/2023#issuecomment-674457540


   this pr is still a draft now ?



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




[GitHub] [apisix] juzhiyuan commented on issue #2059: bug: Please delete old releases from mirroring system

2020-08-15 Thread GitBox


juzhiyuan commented on issue #2059:
URL: https://github.com/apache/apisix/issues/2059#issuecomment-674402661


   - [ ] SVN
   - [ ] Download Page



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




[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #330: feat(authentication): create authentication module

2020-08-15 Thread GitBox


juzhiyuan commented on pull request #330:
URL: https://github.com/apache/apisix-dashboard/pull/330#issuecomment-674402387


   Could we convert this to Draft(I see there has a convert to draft tip on the 
top right panel)? And you can make it ready anytime when it’s ready :D



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




[GitHub] [apisix] membphis merged pull request #2065: bugfix: avoid setting Server header twice

2020-08-15 Thread GitBox


membphis merged pull request #2065:
URL: https://github.com/apache/apisix/pull/2065


   



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




[GitHub] [apisix] membphis closed issue #2064: bug: remove `more_set_headers 'Server: APISIX web server';` in `bin/apisix`

2020-08-15 Thread GitBox


membphis closed issue #2064:
URL: https://github.com/apache/apisix/issues/2064


   



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




[apisix] branch master updated: bugfix: avoid setting Server header twice (#2065)

2020-08-15 Thread membphis
This is an automated email from the ASF dual-hosted git repository.

membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 0b00e82  bugfix: avoid setting Server header twice (#2065)
0b00e82 is described below

commit 0b00e82773bd71f988d5306ee886d9d1b795708f
Author: 罗泽轩 
AuthorDate: Sat Aug 15 17:19:35 2020 +0800

bugfix: avoid setting Server header twice (#2065)

Fix #2064.
---
 .travis/apisix_cli_test.sh | 10 ++
 bin/apisix |  1 -
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.travis/apisix_cli_test.sh b/.travis/apisix_cli_test.sh
index d27df6b..020a90a 100755
--- a/.travis/apisix_cli_test.sh
+++ b/.travis/apisix_cli_test.sh
@@ -25,6 +25,16 @@ set -ex
 
 git checkout conf/config.yaml
 
+# check 'Server: APISIX' is not in nginx.conf. We already added it in Lua code.
+make init
+
+if grep "Server: APISIX" conf/nginx.conf > /dev/null; then
+echo "failed: 'Server: APISIX' should not be added twice"
+exit 1
+fi
+
+echo "passed: 'Server: APISIX' not in nginx.conf"
+
 # check whether the 'reuseport' is in nginx.conf .
 make init
 
diff --git a/bin/apisix b/bin/apisix
index bc1e4e1..625f584 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -238,7 +238,6 @@ http {
 send_timeout {* http.send_timeout *};
 
 server_tokens off;
-more_set_headers 'Server: APISIX web server';
 
 include mime.types;
 charset utf-8;



[GitHub] [apisix] swayamraina commented on issue #1877: request help: add version in http response `server` header

2020-08-15 Thread GitBox


swayamraina commented on issue #1877:
URL: https://github.com/apache/apisix/issues/1877#issuecomment-674369751


   Yes, will fix this



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




[GitHub] [apisix] spacewander opened a new pull request #2065: bugfix: avoid setting Server header twice

2020-08-15 Thread GitBox


spacewander opened a new pull request #2065:
URL: https://github.com/apache/apisix/pull/2065


   Fix #2064.
   
   ### What this PR does / why we need it:
   
   
   
   ### Pre-submission checklist:
   
   * [x] Did you explain what problem does this PR solve? Or what new features 
have been added?
   * [x] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [x] Is this PR backward compatible?
   



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