[GitHub] [apisix-ingress-controller] codecov-commenter edited a comment on pull request #920: fix: export apisix type for encoding/json package

2022-03-15 Thread GitBox


codecov-commenter edited a comment on pull request #920:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/920#issuecomment-1066955825


   # 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#920](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (58f2637) into 
[master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/75098d1e4b26136de3164a3aabd6ed018ffdcd6b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (75098d1) will **increase** coverage by `0.00%`.
   > The diff coverage is `12.12%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920/graphs/tree.svg?width=650&height=150&src=pr&token=WPLQXPY3V0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master #920   +/-   ##
   ===
 Coverage   31.90%   31.91%   
   ===
 Files  72   73+1 
 Lines7899 7900+1 
   ===
   + Hits 2520 2521+1 
 Misses   5103 5103   
 Partials  276  276   
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[pkg/ingress/apisix\_pluginconfig.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2luZ3Jlc3MvYXBpc2l4X3BsdWdpbmNvbmZpZy5nbw==)
 | `0.00% <0.00%> (ø)` | |
   | 
[pkg/ingress/apisix\_route.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2luZ3Jlc3MvYXBpc2l4X3JvdXRlLmdv)
 | `0.00% <0.00%> (ø)` | |
   | 
[pkg/kube/translation/translator.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vdHJhbnNsYXRvci5nbw==)
 | `46.07% <0.00%> (ø)` | |
   | 
[pkg/ingress/ingress.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2luZ3Jlc3MvaW5ncmVzcy5nbw==)
 | `6.59% <40.00%> (ø)` | |
   | 
[test/e2e/e2e.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-dGVzdC9lMmUvZTJlLmdv)
 | `100.00% <0.00%> (ø)` | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Last update 
[11bd92b...58f2637](https://codecov.io/gh/apache/apisix-ingress-controller/pull/920?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+F

[GitHub] [apisix] xianshun163 commented on issue #5604: bug: The latency of request is not stable as expected

2022-03-15 Thread GitBox


xianshun163 commented on issue #5604:
URL: https://github.com/apache/apisix/issues/5604#issuecomment-1067669408


   @jagerzhang Have you solved this problem? I found that the official code has 
been merged, about the prometheus  plugin deps
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] juzhiyuan commented on a change in pull request #6610: docs: move keyword definition to `Terminology` section and improve

2022-03-15 Thread GitBox


juzhiyuan commented on a change in pull request #6610:
URL: https://github.com/apache/apisix/pull/6610#discussion_r826674718



##
File path: docs/en/latest/terminology/route.md
##
@@ -21,11 +21,13 @@ title: Route
 #
 -->
 
-Routes match the client's request based on defined rules, loads and executes 
the corresponding [plugins](./plugin.md), and forwards the request to the 
specified [Upstream](./upstream.md).
+## Description
+
+Routes match the client's request based on defined rules, load and execute the 
corresponding [plugins](./plugin.md), and forwards the request to the specified 
[Upstream](./upstream.md).
 
 A Route mainly consists of three parts:
 
-1. Matching rules (uri, host, remote address)
+1. Matching rules (`uri`, `host`, `remote address)

Review comment:
   ```suggestion
   1. Matching rules (`uri`, `host`, `remote address`)
   ```

##
File path: docs/en/latest/architecture-design/debug-mode.md
##
@@ -63,10 +63,10 @@ The checker would only check this if the file was updated 
by checking its last m
 | Key | Optional | Description 

  | Default |
 | --- |  | 
-
 | --- |
 | hook_conf.enable| required | Enable/Disable hook debug 
trace. Target module function's input arguments or returned value would be 
printed once this option is enabled. | false   |
-| hook_conf.name  | required | The module list name of the 
hook which has enabled debug trace. 
  | |
-| hook_conf.log_level | required | Logging levels for input 
arguments & returned values.
  | warn|
-| hook_conf.is_print_input_args   | required | Enable/Disable printing input 
arguments.  
   | true|
-| hook_conf.is_print_return_value | required | Enable/Disable printing 
returned values.
  | true|
+| hook_conf.name  | required | The module list name of the 
hook which has enabled debug trace. 
  | |
+| hook_conf.log_level | required | Logging levels for input 
arguments & returned values.
 | warn|
+| hook_conf.is_print_input_args   | required | Enable/Disable printing input 
arguments.  
| true|
+| hook_conf.is_print_return_value | required | Enable/Disable printing 
returned values.
  | true|

Review comment:
   I don't see changes in this section, not sure why GitHub highlighted 
this part.

##
File path: docs/en/latest/config.json
##
@@ -6,18 +6,25 @@
   "label": "Architecture Design",
   "items": [
 "architecture-design/apisix",
-"architecture-design/route",
-"architecture-design/plugin",
-"architecture-design/script",
-"architecture-design/service",
-"architecture-design/consumer",
-"architecture-design/upstream",
-"architecture-design/global-rule",
 "architecture-design/plugin-config",
-"architecture-design/router",
 "architecture-design/debug-mode"
   ]
 },
+{
+  "type": "category",
+  "label": "Terminology",
+  "items": [
+"terminology/api-gateway",

Review comment:
   cc @membphis, if we need to adjust those items' order?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] avinal commented on a change in pull request #6610: docs: move keyword definition to `Terminology` section and improve

2022-03-15 Thread GitBox


avinal commented on a change in pull request #6610:
URL: https://github.com/apache/apisix/pull/6610#discussion_r826680583



##
File path: docs/en/latest/architecture-design/debug-mode.md
##
@@ -63,10 +63,10 @@ The checker would only check this if the file was updated 
by checking its last m
 | Key | Optional | Description 

  | Default |
 | --- |  | 
-
 | --- |
 | hook_conf.enable| required | Enable/Disable hook debug 
trace. Target module function's input arguments or returned value would be 
printed once this option is enabled. | false   |
-| hook_conf.name  | required | The module list name of the 
hook which has enabled debug trace. 
  | |
-| hook_conf.log_level | required | Logging levels for input 
arguments & returned values.
  | warn|
-| hook_conf.is_print_input_args   | required | Enable/Disable printing input 
arguments.  
   | true|
-| hook_conf.is_print_return_value | required | Enable/Disable printing 
returned values.
  | true|
+| hook_conf.name  | required | The module list name of the 
hook which has enabled debug trace. 
  | |
+| hook_conf.log_level | required | Logging levels for input 
arguments & returned values.
 | warn|
+| hook_conf.is_print_input_args   | required | Enable/Disable printing input 
arguments.  
| true|
+| hook_conf.is_print_return_value | required | Enable/Disable printing 
returned values.
  | true|

Review comment:
   I think this is just reformatted, removed tabs and instead used spaces, 
a precaution for indentation-sensitive languages. Tabs and spaces are often 
mixed and can cause issues, so it is preferred to use spaces everywhere until 
otherwise needed.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] avinal commented on a change in pull request #6610: docs: move keyword definition to `Terminology` section and improve

2022-03-15 Thread GitBox


avinal commented on a change in pull request #6610:
URL: https://github.com/apache/apisix/pull/6610#discussion_r826681753



##
File path: docs/en/latest/config.json
##
@@ -6,18 +6,25 @@
   "label": "Architecture Design",
   "items": [
 "architecture-design/apisix",
-"architecture-design/route",
-"architecture-design/plugin",
-"architecture-design/script",
-"architecture-design/service",
-"architecture-design/consumer",
-"architecture-design/upstream",
-"architecture-design/global-rule",
 "architecture-design/plugin-config",
-"architecture-design/router",
 "architecture-design/debug-mode"
   ]
 },
+{
+  "type": "category",
+  "label": "Terminology",
+  "items": [
+"terminology/api-gateway",

Review comment:
   I have put them in alphabetical order, as we do with dictionaries since 
terminologies are similar to dictionaries. Please let me know if anything else 
is more accurate.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-website] branch master updated: chore: change the default color of the font in the button (#956)

2022-03-15 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 5c04d04  chore: change the default color of the font in the button 
(#956)
5c04d04 is described below

commit 5c04d045edfd9f7afcc1c9ed53b04af28be4a288
Author: 韩振方 <99874763+hanzhenf...@users.noreply.github.com>
AuthorDate: Tue Mar 15 16:11:02 2022 +0800

chore: change the default color of the font in the button (#956)
---
 website/src/css/customTheme.css|  5 +
 website/src/pages/sections/opensourcePromo.jsx | 18 +-
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/website/src/css/customTheme.css b/website/src/css/customTheme.css
index 6895c79..4d60f22 100644
--- a/website/src/css/customTheme.css
+++ b/website/src/css/customTheme.css
@@ -711,6 +711,11 @@ a:hover {
   padding: 5px 12px;
   transition: background 0.5s;
 }
+
+.oss-promo a {
+  color: white;
+}
+
 .oss-promo-cta:hover {
   background: #9b9b9b;
   color: #080808;
diff --git a/website/src/pages/sections/opensourcePromo.jsx 
b/website/src/pages/sections/opensourcePromo.jsx
index fb999fc..9913520 100644
--- a/website/src/pages/sections/opensourcePromo.jsx
+++ b/website/src/pages/sections/opensourcePromo.jsx
@@ -15,33 +15,33 @@ const OpensourcePromo = (props) => {
   
 Learn from developers
 
-  Want to learn Apache APISIX usage, but don’t know where to 
start. Check out our docs. 
-  Like visual information, check out our https://www.youtube.com/channel/UCgPD18cMhOg5rmPVnQhAC8g";>Youtube 
channel for detailed tutorials. Subscribe for more. 
+  Want to learn Apache APISIX usage, but don’t know where to 
start. Check out our docs.
+  Like visual information, check out our https://www.youtube.com/channel/UCgPD18cMhOg5rmPVnQhAC8g";>Youtube 
channel for detailed tutorials. Subscribe for more.
 
   
   
 https://static.apiseven.com/apisix-website/videos/apisix.mp4"; 
loading="lazy" autoPlay={true} poster="" muted={true} loop={true} width="70%" 
height="auto" controls>
   
 
-  
+
 
   
 Be a part of building APISIX
-
+
   Apache APISIX is opensource and ever-growing. Contributors 
are always welcome. Reach out to us on GitHub
   
-
-https://github.com/apache/apisix"; 
style={{textDecoration: "none"}}>Check us out
+
+https://github.com/apache/apisix"; style={{ 
textDecoration: "none" }}>Check us out
   
 
   
   
-
-  
+
+  
 
   
 
   );
 }
-  
+
 export default OpensourcePromo;


[GitHub] [apisix-website] juzhiyuan merged pull request #956: chore: Change the default color of the font in the button

2022-03-15 Thread GitBox


juzhiyuan merged pull request #956:
URL: https://github.com/apache/apisix-website/pull/956


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] avinal commented on pull request #6610: docs: move keyword definition to `Terminology` section and improve

2022-03-15 Thread GitBox


avinal commented on pull request #6610:
URL: https://github.com/apache/apisix/pull/6610#issuecomment-1067686412


   
   > One question: do we need to use Docusaurus's markup in this PR? I mean 
`:::note` instead of `## NOTE`.
   > 
   > I personally would prefer using Docusaurus's advanced features in another 
PR, to format all markdown files in once.
   
   That will work too, and my suggestion is to use advanced docusauraus markup 
since they can make the documentation rich and help navigate and highlight 
important parts. For now, I will remove them from this PR 👍🏼 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] avinal commented on pull request #6610: docs: move keyword definition to `Terminology` section and improve

2022-03-15 Thread GitBox


avinal commented on pull request #6610:
URL: https://github.com/apache/apisix/pull/6610#issuecomment-1067687793


   Also, I just noticed they are already in use in many of the docs, so can I 
keep it?
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] juzhiyuan commented on pull request #6610: docs: move keyword definition to `Terminology` section and improve

2022-03-15 Thread GitBox


juzhiyuan commented on pull request #6610:
URL: https://github.com/apache/apisix/pull/6610#issuecomment-1067692577


   > Also, I just noticed they are already in use in many of the docs, so can I 
keep it?
   
   OK 😉


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] juzhiyuan commented on a change in pull request #6610: docs: move keyword definition to `Terminology` section and improve

2022-03-15 Thread GitBox


juzhiyuan commented on a change in pull request #6610:
URL: https://github.com/apache/apisix/pull/6610#discussion_r826693242



##
File path: docs/en/latest/config.json
##
@@ -6,18 +6,25 @@
   "label": "Architecture Design",
   "items": [
 "architecture-design/apisix",
-"architecture-design/route",
-"architecture-design/plugin",
-"architecture-design/script",
-"architecture-design/service",
-"architecture-design/consumer",
-"architecture-design/upstream",
-"architecture-design/global-rule",
 "architecture-design/plugin-config",
-"architecture-design/router",
 "architecture-design/debug-mode"
   ]
 },
+{
+  "type": "category",
+  "label": "Terminology",
+  "items": [
+"terminology/api-gateway",

Review comment:
   How about this way:
   
   1. API Gateway
   2. Consumer
   3. Upstream
   4. Route
   5. Service
   6. xxx




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] shuaijinchao opened a new pull request #6615: fix(log-rotate): log rotate time align

2022-03-15 Thread GitBox


shuaijinchao opened a new pull request #6615:
URL: https://github.com/apache/apisix/pull/6615


   ### Description
   
   FIX #6517
   LINK #6521
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added in this PR
   - [x] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backwards compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] juzhiyuan commented on a change in pull request #6610: docs: move keyword definition to `Terminology` section and improve

2022-03-15 Thread GitBox


juzhiyuan commented on a change in pull request #6610:
URL: https://github.com/apache/apisix/pull/6610#discussion_r826693242



##
File path: docs/en/latest/config.json
##
@@ -6,18 +6,25 @@
   "label": "Architecture Design",
   "items": [
 "architecture-design/apisix",
-"architecture-design/route",
-"architecture-design/plugin",
-"architecture-design/script",
-"architecture-design/service",
-"architecture-design/consumer",
-"architecture-design/upstream",
-"architecture-design/global-rule",
 "architecture-design/plugin-config",
-"architecture-design/router",
 "architecture-design/debug-mode"
   ]
 },
+{
+  "type": "category",
+  "label": "Terminology",
+  "items": [
+"terminology/api-gateway",

Review comment:
   How about this way:
   
   1. API Gateway
   2. Consumer
   3. Upstream
   4. Route
   5. Service
   6. xxx
   
   People may know something first, then something else 😉




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] avinal commented on pull request #6610: docs: move keyword definition to `Terminology` section and improve

2022-03-15 Thread GitBox


avinal commented on pull request #6610:
URL: https://github.com/apache/apisix/pull/6610#issuecomment-1067697919


   > LGTM except the sidebar smile
   
   Things will get messy at first before everything comes to a beautiful order. 
😄 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-python-plugin-runner] codecov[bot] commented on pull request #48: ci(e2e): add e2e framework and example plugin case

2022-03-15 Thread GitBox


codecov[bot] commented on pull request #48:
URL: 
https://github.com/apache/apisix-python-plugin-runner/pull/48#issuecomment-1067723723


   # 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#48](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (8fa8e5a) into 
[master](https://codecov.io/gh/apache/apisix-python-plugin-runner/commit/ed4dbe6d7fdc1cd0828f6ab6dfcebc1ccae08258?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (ed4dbe6) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48/graphs/tree.svg?width=650&height=150&src=pr&token=ZKYTA1SBDB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master  #48   +/-   ##
   ===
 Coverage   91.72%   91.72%   
   ===
 Files  11   11   
 Lines 749  749   
   ===
 Hits  687  687   
 Misses 62   62   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Last update 
[ed4dbe6...8fa8e5a](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] liangliang4ward opened a new issue #2381: proxy-rewrite.regex_uri need empty value to replaced

2022-03-15 Thread GitBox


liangliang4ward opened a new issue #2381:
URL: https://github.com/apache/apisix-dashboard/issues/2381


   ### Issue description
   
   at dashboard when proxy-rewrite.regex-uri can't replace empty value;but use 
apisix api support empty value.
   ![Uploading image.png…]()
   
   
   ### Expected behavior
   
   support empty value to replaced
   
   ### How to Reproduce
   
   use dashboard plugin-rewrite plugin
   
   ### Screenshots
   
   _No response_
   
   ### Environment
   
   - apisix version (cmd: `apisix version`): 2.12.1& dashboard lasted
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `etcd --version`):
   - apisix-dashboard version, if have:
   - Browser version, if have:
   
   
   ### Additional context
   
   _No response_


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] juzhiyuan commented on a change in pull request #6568: docs(lint): import Chinese copywriting autocorrect linter

2022-03-15 Thread GitBox


juzhiyuan commented on a change in pull request #6568:
URL: https://github.com/apache/apisix/pull/6568#discussion_r826741259



##
File path: docs/zh/latest/plugins/proxy-control.md
##
@@ -25,7 +25,7 @@ title: proxy-control
 
 `proxy-control` 能够动态地控制 Nginx 代理的行为。
 
-**这个插件需要APISIX在 
[APISIX-OpenResty](../how-to-build.md#步骤6:为-apache-apisix-构建-openresty)上运行。**
+**这个插件需要 APISIX 在 [APISIX-OpenResty](../how-to-build.md#步骤 
6:为-apache-apisix-构建-openresty) 上运行。**

Review comment:
   ditto

##
File path: docs/zh/latest/plugins/gzip.md
##
@@ -25,7 +25,7 @@ title: gzip
 
 `gzip` 插件能动态设置 `Nginx` 的压缩行为。
 
-**该插件要求 `APISIX` 运行在 
[APISIX-OpenResty](../how-to-build.md#步骤6:为-apache-apisix-构建-openresty) 上。**
+**该插件要求 `APISIX` 运行在 [APISIX-OpenResty](../how-to-build.md#步骤 
6:为-apache-apisix-构建-openresty) 上。**

Review comment:
   🤔 We'd better use English and Number as Markdown's Heading IDs

##
File path: .github/workflows/doc-lint.yml
##
@@ -34,3 +34,15 @@ jobs:
 echo "You need to run ./utils/fix-zh-doc-segment.py to fix them."
 exit 1
   fi
+
+  Chinse-Copywriting-lint:
+name: Chinese Copywriting
+runs-on: ubuntu-latest
+timeout-minutes: 1
+steps:
+  - uses: actions/checkout@v3
+  - name: check Chinese copywriting
+run: |
+  curl -sSL https://git.io/JcGER | bash
+  autocorrect --version

Review comment:
   Hi, will this change PR's contents?

##
File path: docs/zh/latest/plugins/real-ip.md
##
@@ -27,7 +27,7 @@ title: real-ip
 
 它工作方式和 `Nginx` 里 `ngx_http_realip_module` 模块一样,并且更为灵活。
 
-**该插件要求 `APISIX` 运行在 
[APISIX-OpenResty](../how-to-build.md#步骤6:为-apache-apisix-构建-openresty) 上。**
+**该插件要求 `APISIX` 运行在 [APISIX-OpenResty](../how-to-build.md#步骤 
6:为-apache-apisix-构建-openresty) 上。**

Review comment:
   ditto

##
File path: .github/workflows/doc-lint.yml
##
@@ -34,3 +34,15 @@ jobs:
 echo "You need to run ./utils/fix-zh-doc-segment.py to fix them."
 exit 1
   fi
+
+  Chinse-Copywriting-lint:
+name: Chinese Copywriting
+runs-on: ubuntu-latest
+timeout-minutes: 1
+steps:
+  - uses: actions/checkout@v3
+  - name: check Chinese copywriting
+run: |
+  curl -sSL https://git.io/JcGER | bash
+  autocorrect --version

Review comment:
   Also, could we use a submodule to execute this CI for security 
considerations?




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] liangliang4ward commented on pull request #6607: docs: unify query string

2022-03-15 Thread GitBox


liangliang4ward commented on pull request #6607:
URL: https://github.com/apache/apisix/pull/6607#issuecomment-1067743622


   > ase update your PR's checklist :)
   
   ok


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on issue #6602: request help: real_ip_recursive for real-ip plugin

2022-03-15 Thread GitBox


tokers commented on issue #6602:
URL: https://github.com/apache/apisix/issues/6602#issuecomment-1067743961


   @crazyMonkey1995 Would you like to try it?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-website] juzhiyuan commented on issue #667: feat: add Apache APISIX dashboard playground on website

2022-03-15 Thread GitBox


juzhiyuan commented on issue #667:
URL: https://github.com/apache/apisix-website/issues/667#issuecomment-1067744543


   I would prefer showing the demo account information directly :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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-python-plugin-runner] codecov[bot] edited a comment on pull request #48: ci(e2e): add e2e framework and example plugin case

2022-03-15 Thread GitBox


codecov[bot] edited a comment on pull request #48:
URL: 
https://github.com/apache/apisix-python-plugin-runner/pull/48#issuecomment-1067723723


   # 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#48](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (8fa8e5a) into 
[master](https://codecov.io/gh/apache/apisix-python-plugin-runner/commit/ed4dbe6d7fdc1cd0828f6ab6dfcebc1ccae08258?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (ed4dbe6) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 8fa8e5a differs from pull request most recent 
head ebd3574. Consider uploading reports for the commit ebd3574 to get more 
accurate results
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48/graphs/tree.svg?width=650&height=150&src=pr&token=ZKYTA1SBDB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master  #48   +/-   ##
   ===
 Coverage   91.72%   91.72%   
   ===
 Files  11   11   
 Lines 749  749   
   ===
 Hits  687  687   
 Misses 62   62   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Last update 
[ed4dbe6...ebd3574](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on issue #6566: docs: The description of configuration item "apisix.allow_admin" ,two official documents are opposite!

2022-03-15 Thread GitBox


tokers commented on issue #6566:
URL: https://github.com/apache/apisix/issues/6566#issuecomment-1067747065


   > the opposite description
   official website :https://apisix.apache.org/zh/docs/apisix/FAQ
   the configuration item "apisix.allow_admin" ,the description is "By default, 
Apache APISIX only allows 127.0.0.0/24 IP address range to access the Admin API"
   
   By default not means empty but also contains some default settings from 
APISIX's config-default.yaml.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-website] SkyeYoung commented on issue #667: feat: add Apache APISIX dashboard playground on website

2022-03-15 Thread GitBox


SkyeYoung commented on issue #667:
URL: https://github.com/apache/apisix-website/issues/667#issuecomment-1067747796


   > I would prefer showing the demo account information directly :D
   
   @juzhiyuan What do you think of [my 
prototype](https://www.figma.com/file/vlLJj7YTnWLpzHaZYl20yt/Dashboard-Playground?node-id=30%3A11)?
 I've tried my best. :P


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-python-plugin-runner] codecov[bot] edited a comment on pull request #48: ci(e2e): add e2e framework and example plugin case

2022-03-15 Thread GitBox


codecov[bot] edited a comment on pull request #48:
URL: 
https://github.com/apache/apisix-python-plugin-runner/pull/48#issuecomment-1067723723


   # 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#48](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (85b4f11) into 
[master](https://codecov.io/gh/apache/apisix-python-plugin-runner/commit/ed4dbe6d7fdc1cd0828f6ab6dfcebc1ccae08258?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (ed4dbe6) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 85b4f11 differs from pull request most recent 
head ebd3574. Consider uploading reports for the commit ebd3574 to get more 
accurate results
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48/graphs/tree.svg?width=650&height=150&src=pr&token=ZKYTA1SBDB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master  #48   +/-   ##
   ===
 Coverage   91.72%   91.72%   
   ===
 Files  11   11   
 Lines 749  749   
   ===
 Hits  687  687   
 Misses 62   62   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Last update 
[ed4dbe6...ebd3574](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on issue #6580: feat: Redesign the architecture of the plugin system

2022-03-15 Thread GitBox


tokers commented on issue #6580:
URL: https://github.com/apache/apisix/issues/6580#issuecomment-1067749027


   > > But since we use the array to orchestrate plugins, I think we can remove 
the priority field.
   > 
   > I don't think so. AFAIK, plugins can be set on different levels (`Route` 
or `Service`). Hence, you need a way to merge their orders - be explicit about 
it. Does it make sense or am I wrong?
   
   IMHO that's confusing, the intuitive order is Route > Service, if we let 
users decide the order, it's error-prone.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] nfrankel commented on issue #6580: feat: Redesign the architecture of the plugin system

2022-03-15 Thread GitBox


nfrankel commented on issue #6580:
URL: https://github.com/apache/apisix/issues/6580#issuecomment-1067753451


   Imagine the user has defined a Service with plugin A and priority 5. Now, 
they define a route with plugin B and C.
   
   How would you compute the order based on the array?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-website] juzhiyuan commented on issue #667: feat: add Apache APISIX dashboard playground on website

2022-03-15 Thread GitBox


juzhiyuan commented on issue #667:
URL: https://github.com/apache/apisix-website/issues/667#issuecomment-1067754959


   LGTM 🎉 🙌


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-python-plugin-runner] codecov[bot] edited a comment on pull request #48: ci(e2e): add e2e framework and example plugin case

2022-03-15 Thread GitBox


codecov[bot] edited a comment on pull request #48:
URL: 
https://github.com/apache/apisix-python-plugin-runner/pull/48#issuecomment-1067723723


   # 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#48](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (85b4f11) into 
[master](https://codecov.io/gh/apache/apisix-python-plugin-runner/commit/ed4dbe6d7fdc1cd0828f6ab6dfcebc1ccae08258?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (ed4dbe6) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 85b4f11 differs from pull request most recent 
head 192e872. Consider uploading reports for the commit 192e872 to get more 
accurate results
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48/graphs/tree.svg?width=650&height=150&src=pr&token=ZKYTA1SBDB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master  #48   +/-   ##
   ===
 Coverage   91.72%   91.72%   
   ===
 Files  11   11   
 Lines 749  749   
   ===
 Hits  687  687   
 Misses 62   62   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Last update 
[ed4dbe6...192e872](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-python-plugin-runner] codecov[bot] edited a comment on pull request #48: ci(e2e): add e2e framework and example plugin case

2022-03-15 Thread GitBox


codecov[bot] edited a comment on pull request #48:
URL: 
https://github.com/apache/apisix-python-plugin-runner/pull/48#issuecomment-1067723723


   # 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#48](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (8eb977d) into 
[master](https://codecov.io/gh/apache/apisix-python-plugin-runner/commit/ed4dbe6d7fdc1cd0828f6ab6dfcebc1ccae08258?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (ed4dbe6) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 8eb977d differs from pull request most recent 
head 192e872. Consider uploading reports for the commit 192e872 to get more 
accurate results
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48/graphs/tree.svg?width=650&height=150&src=pr&token=ZKYTA1SBDB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master  #48   +/-   ##
   ===
 Coverage   91.72%   91.72%   
   ===
 Files  11   11   
 Lines 749  749   
   ===
 Hits  687  687   
 Misses 62   62   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Last update 
[ed4dbe6...192e872](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] crazyMonkey1995 commented on issue #6602: request help: real_ip_recursive for real-ip plugin

2022-03-15 Thread GitBox


crazyMonkey1995 commented on issue #6602:
URL: https://github.com/apache/apisix/issues/6602#issuecomment-1067758600


   > @crazyMonkey1995 Would you like to try it?
   
   Okay, but maybe not so soon.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-python-plugin-runner] codecov[bot] edited a comment on pull request #48: ci(e2e): add e2e framework and example plugin case

2022-03-15 Thread GitBox


codecov[bot] edited a comment on pull request #48:
URL: 
https://github.com/apache/apisix-python-plugin-runner/pull/48#issuecomment-1067723723


   # 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#48](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (8eb977d) into 
[master](https://codecov.io/gh/apache/apisix-python-plugin-runner/commit/ed4dbe6d7fdc1cd0828f6ab6dfcebc1ccae08258?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (ed4dbe6) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 8eb977d differs from pull request most recent 
head 5ad5e29. Consider uploading reports for the commit 5ad5e29 to get more 
accurate results
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48/graphs/tree.svg?width=650&height=150&src=pr&token=ZKYTA1SBDB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master  #48   +/-   ##
   ===
 Coverage   91.72%   91.72%   
   ===
 Files  11   11   
 Lines 749  749   
   ===
 Hits  687  687   
 Misses 62   62   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Last update 
[ed4dbe6...5ad5e29](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-python-plugin-runner] codecov[bot] edited a comment on pull request #48: ci(e2e): add e2e framework and example plugin case

2022-03-15 Thread GitBox


codecov[bot] edited a comment on pull request #48:
URL: 
https://github.com/apache/apisix-python-plugin-runner/pull/48#issuecomment-1067723723


   # 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#48](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (c36e7d9) into 
[master](https://codecov.io/gh/apache/apisix-python-plugin-runner/commit/ed4dbe6d7fdc1cd0828f6ab6dfcebc1ccae08258?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (ed4dbe6) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head c36e7d9 differs from pull request most recent 
head 5ad5e29. Consider uploading reports for the commit 5ad5e29 to get more 
accurate results
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48/graphs/tree.svg?width=650&height=150&src=pr&token=ZKYTA1SBDB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master  #48   +/-   ##
   ===
 Coverage   91.72%   91.72%   
   ===
 Files  11   11   
 Lines 749  749   
   ===
 Hits  687  687   
 Misses 62   62   
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Last update 
[ed4dbe6...5ad5e29](https://codecov.io/gh/apache/apisix-python-plugin-runner/pull/48?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Chever-John opened a new pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John opened a new pull request #6616:
URL: https://github.com/apache/apisix/pull/6616


   ### Description
   Add a Chinese version of the document.
   
   
   
   
   Fixes # (issue)
   #6406 
   ### Checklist
   
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added in this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backwards compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r826781326



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。
+
+这个插件具备将多个指标组成一个批处理,一起推送给外部 Datadog 
代理的能力,且重复使用同一个数据报套接字。如果你没有收到日志数据,不要担心,给它一些时间。在我们批处理程序中的定时器功能到期后,它会自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。   
 |
+| constant_tags | array | optional| [ "source:apisix" ] |  | 
嵌入到生成指标中的静态标签。这对某些信号度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name   | StatsD Type   | Description   |
+| ---   | ---   | ---   |
+| Request Counter   | Counter   | No of requests received.   |

Review comment:
   I am waiting for the exact explanation of the original author 
@bisakhmondal  here. 
   Please do not review it for the time being.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] dantegarden opened a new issue #921: How to use apisix-python-plugin-runner with apisix-ingress

2022-03-15 Thread GitBox


dantegarden opened a new issue #921:
URL: https://github.com/apache/apisix-ingress-controller/issues/921


   我在k8s集群中部署了Apisix Ingress 2.12.1,apisix可以正常工作。
   
我想写一个自定义插件用于实现特殊的鉴权逻辑,通过参考[apisix-python-plugin-runner](https://github.com/apache/apisix-python-plugin-runner)的master分支,写了一个自定义插件的demo:
   ```python3
   class Authorization(PluginBase):
   
   def name(self) -> str:
   """
   The name of the plugin registered in the runner
   :return:
   """
   return "authorization"
   
   def config(self, conf: Any) -> Any:
   """
   Parse plugin configuration
   :param conf:
   :return:
   """
   return conf
   
   def filter(self, conf: Any, request: Request, response: Response):
   """
   The plugin executes the main function
   :param conf:
   plugin configuration after parsing
   :param request:
   request parameters and information
   :param response:
   response parameters and information
   :return:
   """
   host = request.get_var("host")
   method = request.get_method()
   print("host:", host, "method", method)
   
   # print plugin configuration
   print(conf)
   
   # 1.获取token
   cookie = request.get_header("cookie")
   if not cookie:
   unauthorized(response)
   
   try:
   token = None
   cookie_items = cookie.split(";")
   for cookie_item in cookie_items:
   key, value = cookie_item.split("=", 1)
   key = key.strip()
   if key == "login_ticket":
   token = value.strip()
   token = urllib.parse.unquote(token, encoding='utf-8')
   break
   
   if not token:
   unauthorized(response)
   
   return
   
   except Exception as err:
   print(err)
   traceback.print_exc()
   internal_error(response)
   ```
   
   然后我重新制作了apisix镜像,Dockerfile如下:
   ```
   FROM apache/apisix:2.12.1-alpine
   
   ADD ./apisix-python-plugin-runner /apisix-python-plugin-runner
   
   RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' 
/etc/apk/repositories && \
   apk add --update python3 py3-pip && \
   apk add gcc g++ make libffi-dev openssl-dev libtool && \
   python3 -m pip install --upgrade pip -i https://pypi.douban.com/simple/  
&& \
   python3 -m pip install a6pluginprotos==0.2.1 click==8.0.1 
minicache==0.0.1 PyYAML==5.4.1 --ignore-installed -i 
https://pypi.douban.com/simple/
   
   RUN cd /apisix-python-plugin-runner && \
   make setup && \
   make install
   ```
   
   我将helm template中的镜像改完新制作的镜像,并修改configmap,使config.yml增加:
   ```
   ext-plugin:
 cmd:
 - python3
 - /apisix-python-plugin-runner/bin/py-runner
 - start
   ```
   
   随后我重新`helm install apisix`,pod可以正常启动,原本的apisixroute也可以正常代理流量。
   
   我尝试创建一个ApisixRoute,并使用我的自定义插件:
   ```yaml
   apiVersion: apisix.apache.org/v2beta2
   kind: ApisixRoute
   metadata:
 name: demo-test
 namespace: default
   spec:
 http:
 - name: rule1
   match:
 hosts:
 - a1.demo.test
 paths:
 - /*
   backends:
   - serviceName: demo-svc
 servicePort: 3
   websocket: true
   plugins:
   - name: authorization
 enable: true
 config:
   conf:
   - name: "authorization"
 value: "{\"redis\": {\"host\":\"192.168.1.64\", \"port\":6379, 
\"password\":\"OneFlow@123456\", \"database\":0}}"
   ```
   此时访问 http://a1.demo.test 返回:
   ```json
   {
   error_msg: "404 Route Not Found"
   }
   ```
   将上面yaml中的plugins移除,重新创建apisixroute,访问http://a1.demo.test可以正常转发。
   
   由于apisix-python-plugin-runner文档过于简单,不知道究竟应该如何在k8s中使用。
   我想知道如何使用自定义plugin?能否提供一个apisix ingress与apisix-python-plugin-runner结合的demo?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] bisakhmondal commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


bisakhmondal commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r826789772



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。
+
+这个插件具备将多个指标组成一个批处理,一起推送给外部 Datadog 
代理的能力,且重复使用同一个数据报套接字。如果你没有收到日志数据,不要担心,给它一些时间。在我们批处理程序中的定时器功能到期后,它会自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。   
 |
+| constant_tags | array | optional| [ "source:apisix" ] |  | 
嵌入到生成指标中的静态标签。这对某些信号度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name   | StatsD Type   | Description   |
+| ---   | ---   | ---   |
+| Request Counter   | Counter   | No of requests received.   |

Review comment:
   Yeah sure. Actually, let me give you a broader perspective. In the 
APISIX ecosystem, a plugin can be attached with routes, services or consumers, 
right? At the end of the day, a lifecycle (different openresty states) of 
plugins gets triggered via a request to a particular route no matter where it 
is attached.
   Here the request counter exposes a counter metric of the total number of 
connections that have hit that particular route. It aggregates it and shows it 
in a single metric.
   
   I have used the shorthand of `Number` as `No` here. I think it's getting 
confusing. Please update the English doc as well. Thanks.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Dog-Lee commented on pull request #6512: feat: support google reCAPTCHA

2022-03-15 Thread GitBox


Dog-Lee commented on pull request #6512:
URL: https://github.com/apache/apisix/pull/6512#issuecomment-1067801773


   Hi guys. Any progress on this PR? When this PR can be merged?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander opened a new pull request #6617: fix(skywalking,opentelemetry): trace request rejected by auth

2022-03-15 Thread GitBox


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


   Signed-off-by: spacewander 
   
   ### Description
   
   
   
   
   Fixes https://github.com/apache/apisix/issues/6601
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added in this PR
   - [x] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backwards compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] moonming commented on pull request #6512: feat: support google reCAPTCHA

2022-03-15 Thread GitBox


moonming commented on pull request #6512:
URL: https://github.com/apache/apisix/pull/6512#issuecomment-1067832378


   > 
   
   CI has not passed, do you need help with 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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Dog-Lee commented on pull request #6512: feat: support google reCAPTCHA

2022-03-15 Thread GitBox


Dog-Lee commented on pull request #6512:
URL: https://github.com/apache/apisix/pull/6512#issuecomment-1067842156


   ```
   Failed test 't/plugin/api-breaker.t TEST 19: hit route 20 times, confirm the 
breaker time - pattern "phase_func(): breaker_time: 2" should match a line in 
error.log (req 0)'
   ```
   
   The CI output is confusing. I don't think it's related to the recaptcha. 
Please correct me if I'm wrong.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Dog-Lee edited a comment on pull request #6512: feat: support google reCAPTCHA

2022-03-15 Thread GitBox


Dog-Lee edited a comment on pull request #6512:
URL: https://github.com/apache/apisix/pull/6512#issuecomment-1067842156


   ```
   ++ ./t/grpc_server_example/grpc_server_example -grpc-address :50051 
-grpcs-address :50052 -grpcs-mtls-address :50053 -crt ./t/certs/apisix.crt -key 
./t/certs/apisix.key -ca ./t/certs/mtls_ca.crt
   nc: connect to 127.0.0.1 port 50051 (tcp) failed: Connection refused
   ...
   Failed test 't/plugin/api-breaker.t TEST 19: hit route 20 times, confirm the 
breaker time - pattern "phase_func(): breaker_time: 2" should match a line in 
error.log (req 0)'
   ```
   
   The CI output is confusing. I don't think it's related to the recaptcha. 
Please correct me if I'm wrong.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] nic-6443 commented on a change in pull request #6512: feat: support google reCAPTCHA

2022-03-15 Thread GitBox


nic-6443 commented on a change in pull request #6512:
URL: https://github.com/apache/apisix/pull/6512#discussion_r826836292



##
File path: apisix/plugins/recaptcha.lua
##
@@ -0,0 +1,101 @@
+--
+-- 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.
+--
+local core = require("apisix.core")
+local http = require("resty.http")
+
+local schema = {
+type = "object",
+properties = {
+secret_key = { type = "string" },
+parameter_source = { type = "string", default = "header", enum = { 
"header", "query" } },
+parameter_name = { type = "string", default = "captcha" },
+response = {
+type = "object",
+properties = {
+content_type = { type = "string", default = "application/json; 
charset=utf-8" },
+status_code = { type = "number", default = 400 },
+body = { type = "string", default = '{"message": "invalid 
captcha"}' }
+}
+},
+},
+required = { "secret_key" },
+}
+
+local recaptcha_url = "https://www.recaptcha.net";
+
+local _M = {
+version = 0.1,
+priority = 700,
+name = "recaptcha",
+schema = schema,
+}
+
+function _M.check_schema(conf, schema_type)
+return core.schema.check(schema, conf)
+end
+
+local function retrieve_captcha(ctx, conf)
+local captcha
+if conf.parameter_source == "header" then
+captcha = core.request.header(ctx, conf.parameter_name)
+elseif conf.parameter_source == "query" then
+local uri_args = core.request.get_uri_args(ctx) or {}
+captcha = uri_args[conf.parameter_name]
+end
+return captcha
+end
+
+function _M.access(conf, ctx)
+local path = ctx.var.uri
+local method = core.request.get_method()
+
+core.log.debug("path: ", path, ", method: ", method, ", conf: ", 
core.json.encode(conf))
+
+local invalid_captcha = true
+local captcha = retrieve_captcha(ctx, conf)
+if captcha ~= nil and captcha ~= "" then
+local httpc = http.new()
+local secret = conf.secret_key
+local remote_ip = core.request.get_remote_client_ip(ctx)
+local res, err = httpc:request_uri(recaptcha_url .. 
"/recaptcha/api/siteverify", {

Review comment:
   @Dog-LeeWant to reconsider this review? I think it makes sense to make 
the server-side address configurable.

##
File path: apisix/plugins/recaptcha.lua
##
@@ -0,0 +1,101 @@
+--
+-- 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.
+--
+local core = require("apisix.core")
+local http = require("resty.http")
+
+local schema = {
+type = "object",
+properties = {
+secret_key = { type = "string" },
+parameter_source = { type = "string", default = "header", enum = { 
"header", "query" } },
+parameter_name = { type = "string", default = "captcha" },
+response = {
+type = "object",
+properties = {
+content_type = { type = "string", default = "application/json; 
charset=utf-8" },
+status_code = { type = "number", default = 400 },
+body = { type = "string", default = '{"message": "invalid 
captcha"}' }
+}
+},
+},
+required = { "secret_key" },
+}
+
+local recaptcha_url = "https://www.recaptcha.net";
+
+local _M = {
+version = 0.1,
+priority = 700,
+name = "recaptcha",
+schema = schema,
+}
+
+function _M.check_schema(conf, schema_type)
+return core.schema.che

[GitHub] [apisix] Dog-Lee commented on a change in pull request #6512: feat: support google reCAPTCHA

2022-03-15 Thread GitBox


Dog-Lee commented on a change in pull request #6512:
URL: https://github.com/apache/apisix/pull/6512#discussion_r826847315



##
File path: apisix/plugins/recaptcha.lua
##
@@ -0,0 +1,101 @@
+--
+-- 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.
+--
+local core = require("apisix.core")
+local http = require("resty.http")
+
+local schema = {
+type = "object",
+properties = {
+secret_key = { type = "string" },
+parameter_source = { type = "string", default = "header", enum = { 
"header", "query" } },
+parameter_name = { type = "string", default = "captcha" },
+response = {
+type = "object",
+properties = {
+content_type = { type = "string", default = "application/json; 
charset=utf-8" },
+status_code = { type = "number", default = 400 },
+body = { type = "string", default = '{"message": "invalid 
captcha"}' }
+}
+},
+},
+required = { "secret_key" },
+}
+
+local recaptcha_url = "https://www.recaptcha.net";
+
+local _M = {
+version = 0.1,
+priority = 700,
+name = "recaptcha",
+schema = schema,
+}
+
+function _M.check_schema(conf, schema_type)
+return core.schema.check(schema, conf)
+end
+
+local function retrieve_captcha(ctx, conf)
+local captcha
+if conf.parameter_source == "header" then
+captcha = core.request.header(ctx, conf.parameter_name)
+elseif conf.parameter_source == "query" then
+local uri_args = core.request.get_uri_args(ctx) or {}
+captcha = uri_args[conf.parameter_name]
+end
+return captcha
+end
+
+function _M.access(conf, ctx)
+local path = ctx.var.uri
+local method = core.request.get_method()
+
+core.log.debug("path: ", path, ", method: ", method, ", conf: ", 
core.json.encode(conf))
+
+local invalid_captcha = true
+local captcha = retrieve_captcha(ctx, conf)
+if captcha ~= nil and captcha ~= "" then
+local httpc = http.new()
+local secret = conf.secret_key
+local remote_ip = core.request.get_remote_client_ip(ctx)
+local res, err = httpc:request_uri(recaptcha_url .. 
"/recaptcha/api/siteverify", {

Review comment:
   
https://developers.google.com/recaptcha/docs/faq?hl=en#can-i-use-recaptcha-globally
   > please use "www.recaptcha.net" in your code in circumstances when 
"www.google.com" is not accessible.
   
   Due to the GWF, the Chinese server might not be able to connect with 
www.google.com(and it reproduces in my local env). I think this might be the 
reason why it has www.recaptcha.net domain.
   
   @nic-6443 I would say it's not a must-have feature in the current stage, and 
I can add it in the next version. Can we? : )




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Dog-Lee commented on a change in pull request #6512: feat: support google reCAPTCHA

2022-03-15 Thread GitBox


Dog-Lee commented on a change in pull request #6512:
URL: https://github.com/apache/apisix/pull/6512#discussion_r826847315



##
File path: apisix/plugins/recaptcha.lua
##
@@ -0,0 +1,101 @@
+--
+-- 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.
+--
+local core = require("apisix.core")
+local http = require("resty.http")
+
+local schema = {
+type = "object",
+properties = {
+secret_key = { type = "string" },
+parameter_source = { type = "string", default = "header", enum = { 
"header", "query" } },
+parameter_name = { type = "string", default = "captcha" },
+response = {
+type = "object",
+properties = {
+content_type = { type = "string", default = "application/json; 
charset=utf-8" },
+status_code = { type = "number", default = 400 },
+body = { type = "string", default = '{"message": "invalid 
captcha"}' }
+}
+},
+},
+required = { "secret_key" },
+}
+
+local recaptcha_url = "https://www.recaptcha.net";
+
+local _M = {
+version = 0.1,
+priority = 700,
+name = "recaptcha",
+schema = schema,
+}
+
+function _M.check_schema(conf, schema_type)
+return core.schema.check(schema, conf)
+end
+
+local function retrieve_captcha(ctx, conf)
+local captcha
+if conf.parameter_source == "header" then
+captcha = core.request.header(ctx, conf.parameter_name)
+elseif conf.parameter_source == "query" then
+local uri_args = core.request.get_uri_args(ctx) or {}
+captcha = uri_args[conf.parameter_name]
+end
+return captcha
+end
+
+function _M.access(conf, ctx)
+local path = ctx.var.uri
+local method = core.request.get_method()
+
+core.log.debug("path: ", path, ", method: ", method, ", conf: ", 
core.json.encode(conf))
+
+local invalid_captcha = true
+local captcha = retrieve_captcha(ctx, conf)
+if captcha ~= nil and captcha ~= "" then
+local httpc = http.new()
+local secret = conf.secret_key
+local remote_ip = core.request.get_remote_client_ip(ctx)
+local res, err = httpc:request_uri(recaptcha_url .. 
"/recaptcha/api/siteverify", {

Review comment:
   
https://developers.google.com/recaptcha/docs/faq?hl=en#can-i-use-recaptcha-globally
   > please use "www.recaptcha.net" in your code in circumstances when 
"www.google.com" is not accessible.
   
   Due to the GWF, the Chinese server might not be able to connect with 
`www.google.com` (it reproduces in my local env). I think this might be the 
reason why it has `www.recaptcha.net` domain.
   
   @nic-6443 I would say it's not a must-have feature in the current stage, and 
I can add it in the next version. Can we? : )




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] nic-6443 commented on a change in pull request #6512: feat: support google reCAPTCHA

2022-03-15 Thread GitBox


nic-6443 commented on a change in pull request #6512:
URL: https://github.com/apache/apisix/pull/6512#discussion_r826852033



##
File path: apisix/plugins/recaptcha.lua
##
@@ -0,0 +1,101 @@
+--
+-- 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.
+--
+local core = require("apisix.core")
+local http = require("resty.http")
+
+local schema = {
+type = "object",
+properties = {
+secret_key = { type = "string" },
+parameter_source = { type = "string", default = "header", enum = { 
"header", "query" } },
+parameter_name = { type = "string", default = "captcha" },
+response = {
+type = "object",
+properties = {
+content_type = { type = "string", default = "application/json; 
charset=utf-8" },
+status_code = { type = "number", default = 400 },
+body = { type = "string", default = '{"message": "invalid 
captcha"}' }
+}
+},
+},
+required = { "secret_key" },
+}
+
+local recaptcha_url = "https://www.recaptcha.net";
+
+local _M = {
+version = 0.1,
+priority = 700,
+name = "recaptcha",
+schema = schema,
+}
+
+function _M.check_schema(conf, schema_type)
+return core.schema.check(schema, conf)
+end
+
+local function retrieve_captcha(ctx, conf)
+local captcha
+if conf.parameter_source == "header" then
+captcha = core.request.header(ctx, conf.parameter_name)
+elseif conf.parameter_source == "query" then
+local uri_args = core.request.get_uri_args(ctx) or {}
+captcha = uri_args[conf.parameter_name]
+end
+return captcha
+end
+
+function _M.access(conf, ctx)
+local path = ctx.var.uri
+local method = core.request.get_method()
+
+core.log.debug("path: ", path, ", method: ", method, ", conf: ", 
core.json.encode(conf))
+
+local invalid_captcha = true
+local captcha = retrieve_captcha(ctx, conf)
+if captcha ~= nil and captcha ~= "" then
+local httpc = http.new()
+local secret = conf.secret_key
+local remote_ip = core.request.get_remote_client_ip(ctx)
+local res, err = httpc:request_uri(recaptcha_url .. 
"/recaptcha/api/siteverify", {

Review comment:
   ok




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] sshniro commented on pull request #6586: feat: add support for password grant in keycloak plugin

2022-03-15 Thread GitBox


sshniro commented on pull request #6586:
URL: https://github.com/apache/apisix/pull/6586#issuecomment-1067864904


   > scenario
   
   Hi, are you getting the same error when you run the docker image instance 
(sshniro/keycloak-apisix:latest) locally?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] membphis commented on a change in pull request #6614: feat: support reading configuration form shdict(mvp)

2022-03-15 Thread GitBox


membphis commented on a change in pull request #6614:
URL: https://github.com/apache/apisix/pull/6614#discussion_r826632359



##
File path: apisix/core/config_shdict.lua
##
@@ -0,0 +1,126 @@
+--
+-- 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.
+--
+
+--- Get configuration form ngx.shared.DICT.
+--
+-- @module core.config_shdict
+
+local base  = require("resty.core.base")
+local config_local  = require("apisix.core.config_local")
+local table = table
+local is_http   = ngx.config.subsystem == "http"
+local string= string
+local io= io
+local package   = package
+local new_tab   = base.new_tab
+local ngx_timer_at  = ngx.timer.at
+local ffi   = require 'ffi'
+local C = ffi.C
+local router_config = ngx.shared["router-config"]
+
+local process
+if is_http then
+process = require("ngx.process")
+end
+
+
+ffi.cdef[[
+extern void CreateMock(void* writeRoute);

Review comment:
   change it to standard C style: `create_mock `

##
File path: apisix/core/config_shdict.lua
##
@@ -0,0 +1,126 @@
+--
+-- 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.
+--
+
+--- Get configuration form ngx.shared.DICT.
+--
+-- @module core.config_shdict
+
+local base  = require("resty.core.base")
+local config_local  = require("apisix.core.config_local")
+local table = table
+local is_http   = ngx.config.subsystem == "http"
+local string= string
+local io= io
+local package   = package
+local new_tab   = base.new_tab
+local ngx_timer_at  = ngx.timer.at
+local ffi   = require 'ffi'
+local C = ffi.C
+local router_config = ngx.shared["router-config"]
+
+local process
+if is_http then
+process = require("ngx.process")
+end
+
+
+ffi.cdef[[
+extern void CreateMock(void* writeRoute);

Review comment:
   we should call a `init()` function here

##
File path: apisix/core/config_shdict.lua
##
@@ -0,0 +1,126 @@
+--
+-- 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.
+--
+
+--- Get configuration form ngx.shared.DICT.
+--
+-- @module core.config_shdict
+
+local base  = require("resty.core.base")
+local config_local  = require("apisix.core.config_local")
+local table = table
+local is_http   = ngx.config.subsystem == "http"
+local string= string
+local io= io
+local package   = package
+local new_tab   = base.new_tab
+local ngx_timer_at  = ngx.timer.at
+local ffi   = require 'ffi'

Review comment:
   bad style, change to : `require(

[GitHub] [apisix] spacewander merged pull request #6545: test: remove unnecessary response body data check

2022-03-15 Thread GitBox


spacewander merged pull request #6545:
URL: https://github.com/apache/apisix/pull/6545


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander closed issue #6538: docs: remove invalid response body data of test files

2022-03-15 Thread GitBox


spacewander closed issue #6538:
URL: https://github.com/apache/apisix/issues/6538


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] azilentech commented on pull request #6586: feat: add support for password grant in keycloak plugin

2022-03-15 Thread GitBox


azilentech commented on pull request #6586:
URL: https://github.com/apache/apisix/pull/6586#issuecomment-1067901042


   @sshniro 
   I didn't test that way earlier, but just now, I did that and it is working. 
Also when I see the above checks, that test case is starting to pass now. 
   
   I have got the idea what things might cause that. Earlier I was using '&' to 
split the incoming parameters. but now I am using "ngx.decode_args" ( 
https://github.com/apache/apisix/pull/6586#discussion_r825597553 ).
   
   Because of that earlier, username (which is email) wouldn't parse properly.
   That should be the root cause of the same.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] spacewander opened a new issue #6618: help request: there are two grammar errors in PULL_REQUEST_TEMPLATE.md

2022-03-15 Thread GitBox


spacewander opened a new issue #6618:
URL: https://github.com/apache/apisix/issues/6618


   ### Description
   
   It's easy to find them. Let's fix it.
   PS. if you have contributed to APISIX before, please leave this chance to 
first time contributor.
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] xianshun163 commented on pull request #6315: chore: update ngxin-lua-prometheus verison

2022-03-15 Thread GitBox


xianshun163 commented on pull request #6315:
URL: https://github.com/apache/apisix/pull/6315#issuecomment-1067908367


   @tzssangglass ,I have updated the version of nginx-lua-prometheus  
dependency package. I directly used the new version of dependency package when 
packaging with  dockerfile. 
   My version of apifix is 2.11.0.
As shown in the figure. I found that the apifix delay on grafana is not 
stable, as shown  in the figure. At the beginning, it is 190ms, and then it 
becomes more than 1s.
   
   And, looking at the graph of grafana, the delay is still relatively large.
   
   
![image](https://user-images.githubusercontent.com/32457473/158372138-41961f45-4d31-4b3c-9363-d670ddb0563b.png)
   
   
   
![企业微信截图_16473447444294](https://user-images.githubusercontent.com/32457473/158372288-28530680-2195-437f-900d-0ddb1afae15b.png)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] xianshun163 edited a comment on pull request #6315: chore: update ngxin-lua-prometheus verison

2022-03-15 Thread GitBox


xianshun163 edited a comment on pull request #6315:
URL: https://github.com/apache/apisix/pull/6315#issuecomment-1067908367


   @tzssangglass ,I have updated the version of nginx-lua-prometheus  
dependency package. I directly used the new version of dependency package when 
packaging with  dockerfile. 
   My version of apifix is 2.11.0.
As shown in the figure. I found that the apifix delay on grafana is not 
stable, as shown  in the figure. At the beginning, it is 190ms, and then it 
becomes more than 1s.
   
   And, looking at the graph of grafana, the delay is still relatively large.
   I just piloted a few services. The QPS is less than 100, and the CPU 
utilization of the gateway is also very low.
   
   
![image](https://user-images.githubusercontent.com/32457473/158372138-41961f45-4d31-4b3c-9363-d670ddb0563b.png)
   
   
   
![企业微信截图_16473447444294](https://user-images.githubusercontent.com/32457473/158372288-28530680-2195-437f-900d-0ddb1afae15b.png)
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] xianshun163 edited a comment on pull request #6315: chore: update ngxin-lua-prometheus verison

2022-03-15 Thread GitBox


xianshun163 edited a comment on pull request #6315:
URL: https://github.com/apache/apisix/pull/6315#issuecomment-1067908367


   @tzssangglass ,I have updated the version of nginx-lua-prometheus  
dependency package. I directly used the new version of dependency package when 
packaging with  dockerfile. 
   My version of apifix is 2.11.0.
As shown in the figure. I found that the apifix delay on grafana is not 
stable, as shown  in the figure. At the beginning, it is 190ms, and then it 
becomes more than 1s.
   
   And, looking at the graph of grafana, the delay is still relatively large.
   I just piloted a few services. The QPS is less than 100, and the CPU 
utilization of the gateway is also very low.
   
   
![image](https://user-images.githubusercontent.com/32457473/158372138-41961f45-4d31-4b3c-9363-d670ddb0563b.png)
   
   
   
![企业微信截图_16473447444294](https://user-images.githubusercontent.com/32457473/158372288-28530680-2195-437f-900d-0ddb1afae15b.png)
   
   the access.log of the nginx  print the variable below:
   $request_time $upstream_connect_time $upstream_response_time
   in the access.log   , I can not find the record  who  has  so manay delay 
time.
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] nfrankel opened a new pull request #6619: fix: Correct grammar in PR template

2022-03-15 Thread GitBox


nfrankel opened a new pull request #6619:
URL: https://github.com/apache/apisix/pull/6619


 Fix #6618
   
   ### Description
   
   
   
   
   Fixes # (issue)
   
   ### Checklist
   
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added in this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backwards compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] ComradeProgrammer commented on pull request #6382: feat: add auth plugin for casdoor

2022-03-15 Thread GitBox


ComradeProgrammer commented on pull request #6382:
URL: https://github.com/apache/apisix/pull/6382#issuecomment-1067935059


   Now state has been randomized, other recommended revisions have also been 
made, and now they are in different commits as mentioned before.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] ComradeProgrammer edited a comment on pull request #6382: feat: add auth plugin for casdoor

2022-03-15 Thread GitBox


ComradeProgrammer edited a comment on pull request #6382:
URL: https://github.com/apache/apisix/pull/6382#issuecomment-1067935059


   Now state has been randomized, other recommended revisions have also been 
made, and now they are in different commits as mentioned before. tests have 
also been modified, and special case for "state" is added


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] rpei2022 opened a new issue #6620: bug:

2022-03-15 Thread GitBox


rpei2022 opened a new issue #6620:
URL: https://github.com/apache/apisix/issues/6620


   ### Current Behavior
   
   when I have a try to send a http request to apisix via postman, I get the 
following response from apisix.
   
   
   
   


500 Internal Server Error

body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}

   
   
   
An error occurred.
You can report issue to https://github.com/apache/apisix/issues";>APISIX
Faithfully yours, https://apisix.apache.org/";>APISIX.
   
   
   
   
   and I find the following errors int the apisix error.log.
   
   2022/03/14 13:08:43 [error] 44#44: *204353 lua entry thread aborted: runtime 
error: /usr/local/apisix/apisix/api_router.lua:99: bad argument #1 to 'ipairs' 
(table expected, got nil)
   stack traceback:
   coroutine 0:
   [C]: in function 'ipairs'
   /usr/local/apisix/apisix/api_router.lua:99: in function 
'create_obj_fun'
   /usr/local/apisix/apisix/core/lrucache.lua:91: in function 'global'
   /usr/local/apisix/apisix/api_router.lua:160: in function 'match'
   /usr/local/apisix/apisix/init.lua:380: in function 
'http_access_phase'
   
   
   
   
   
   ### Expected Behavior
   
   I expect to get correct response with no apisix internal  error.
   
   ### Error Logs
   
   2022/03/14 13:08:43 [error] 44#44: *204353 lua entry thread aborted: runtime 
error: /usr/local/apisix/apisix/api_router.lua:99: bad argument #1 to 'ipairs' 
(table expected, got nil)
   stack traceback:
   coroutine 0:
   [C]: in function 'ipairs'
   /usr/local/apisix/apisix/api_router.lua:99: in function 
'create_obj_fun'
   /usr/local/apisix/apisix/core/lrucache.lua:91: in function 'global'
   /usr/local/apisix/apisix/api_router.lua:160: in function 'match'
   /usr/local/apisix/apisix/init.lua:380: in function 
'http_access_phase'
   
   ### Steps to Reproduce
   
   1. Run apisix with the docker-compose
   2. add the example-plugin as the procedure in this 
webline(https://github.com/apache/apisix/blob/master/docs/zh/latest/plugin-develop.md)
   3. add the following code in the example-plugin.lua
   function _M.api()
   return {
   {
   methods = {"GET"},
   uris = {"/v1/plugin/example-plugin/hello"},
   handler = hello,
   }
   }
   end
   4. add one upstream,  the configuration is as the following:
   {
 "nodes": [
   {
 "host": "www.baidu.com",
 "port": 80,
 "weight": 1
   }
 ],
 "timeout": {
   "connect": 6,
   "send": 6,
   "read": 6
 },
 "type": "roundrobin",
 "scheme": "http",
 "pass_host": "pass",
 "name": "moses_test_upstream_1_baidu",
 "keepalive_pool": {
   "idle_timeout": 60,
   "requests": 1000,
   "size": 320
 }
   }
   5. add one route with the follwoing configuration:
   {
 "uri": "/baidu/*",
 "name": "moses_test_route_1",
 "methods": [
   "GET",
   "POST",
   "PUT",
   "DELETE",
   "PATCH",
   "HEAD",
   "OPTIONS",
   "CONNECT",
   "TRACE"
 ],
 "plugins": {
   "prometheus": {
 "disable": false,
 "prefer_name": true
   }
 },
 "upstream_id": "398853061142905944",
 "status": 1
   }
   6. send the following request with postman
   
http://xxx.xxx.xxx.xxx:9080/baidu/link?url=WPc1Tjj5YpzAQ_cRspO9tJcfmQNpPw6KZ2QHflmZ5GwqtFr06A9sKAt8rWoDOfGpzIEBC5mrz46eOOo6kdUh1jHdgWPyTq17o3aPdlEHQT1Phkg6zGJGRSiW4Af1-_GoYAtXTVX91Qn12GgQPi8ORRJQA7VbDPkb0G-LFSPfiGNtDbSeEqd_hhV0jCbHWKotyf7EmLbS4-dy1pDIkcvG3j9Baql7iV8dUT687BpEfx_Z5i4N2DrWTPuhGVlGSC1-2Ds3xhTlyZc5ZB-hy722ekC9NDxs15zeCD8frxBlIlu&wd=&eqid=dc8985310004f5970002622fe34b
   
   ### Environment
   
   -apache/apisix:2.12.1-alpine
   - Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 
22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tzssangglass commented on a change in pull request #6614: feat: support reading configuration form shdict(mvp)

2022-03-15 Thread GitBox


tzssangglass commented on a change in pull request #6614:
URL: https://github.com/apache/apisix/pull/6614#discussion_r826961829



##
File path: t/amesh-agent/config_shdict.t
##
@@ -0,0 +1,84 @@
+#
+# 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.
+#
+use t::APISIX 'no_plan';
+
+use Cwd qw(cwd);
+my $apisix_home = $ENV{APISIX_HOME} || cwd();
+
+repeat_each(1);
+no_long_string();
+no_root_location();
+log_level("info");
+
+add_block_preprocessor(sub {
+my ($block) = @_;
+
+if (!$block->request) {
+$block->set_value("request", "GET /t");
+}
+
+if (!$block->no_error_log) {
+$block->set_value("no_error_log", "[error]\n[alert]");
+}
+
+my $lua_deps_path = $block->lua_deps_path // <<_EOC_;
+lua_package_path 
"$apisix_home/?.lua;$apisix_home/?/init.lua;$apisix_home/deps/share/lua/5.1/?/init.lua;$apisix_home/deps/share/lua/5.1/?.lua;$apisix_home/apisix/?.lua;$apisix_home/t/?.lua;;";
+lua_package_cpath 
"$apisix_home/?.so;$apisix_home/t/amesh-agent/?.so;$apisix_home/deps/lib/lua/5.1/?.so;$apisix_home/deps/lib64/lua/5.1/?.so;;";
+_EOC_
+
+$block->set_value("lua_deps_path", $lua_deps_path);
+});
+
+run_tests;
+
+__DATA__
+
+=== TEST 1: load amesh agent so successfully
+--- yaml_config
+apisix:
+  node_listen: 1984
+  config_center: shdict
+  enable_admin: false
+--- config
+location /t {
+content_by_lua_block {
+ngx.say("ok")
+}
+}
+--- no_error_log eval
+qr/can not load amesh agent/

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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tzssangglass commented on a change in pull request #6614: feat: support reading configuration form shdict(mvp)

2022-03-15 Thread GitBox


tzssangglass commented on a change in pull request #6614:
URL: https://github.com/apache/apisix/pull/6614#discussion_r826962898



##
File path: apisix/core/config_shdict.lua
##
@@ -0,0 +1,126 @@
+--
+-- 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.
+--
+
+--- Get configuration form ngx.shared.DICT.
+--
+-- @module core.config_shdict
+
+local base  = require("resty.core.base")
+local config_local  = require("apisix.core.config_local")
+local table = table
+local is_http   = ngx.config.subsystem == "http"
+local string= string
+local io= io
+local package   = package
+local new_tab   = base.new_tab
+local ngx_timer_at  = ngx.timer.at
+local ffi   = require 'ffi'
+local C = ffi.C
+local router_config = ngx.shared["router-config"]
+
+local process
+if is_http then
+process = require("ngx.process")
+end
+
+
+ffi.cdef[[
+extern void CreateMock(void* writeRoute);

Review comment:
   `init()` is the name of a reserved function of go, with special meaning, 
I replaced it with `initial()`

##
File path: apisix/core/config_shdict.lua
##
@@ -0,0 +1,126 @@
+--
+-- 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.
+--
+
+--- Get configuration form ngx.shared.DICT.
+--
+-- @module core.config_shdict
+
+local base  = require("resty.core.base")
+local config_local  = require("apisix.core.config_local")
+local table = table
+local is_http   = ngx.config.subsystem == "http"
+local string= string
+local io= io
+local package   = package
+local new_tab   = base.new_tab
+local ngx_timer_at  = ngx.timer.at
+local ffi   = require 'ffi'

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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tzssangglass commented on a change in pull request #6614: feat: support reading configuration form shdict(mvp)

2022-03-15 Thread GitBox


tzssangglass commented on a change in pull request #6614:
URL: https://github.com/apache/apisix/pull/6614#discussion_r826964320



##
File path: apisix/core/config_shdict.lua
##
@@ -0,0 +1,126 @@
+--
+-- 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.
+--
+
+--- Get configuration form ngx.shared.DICT.
+--
+-- @module core.config_shdict
+
+local base  = require("resty.core.base")
+local config_local  = require("apisix.core.config_local")
+local table = table
+local is_http   = ngx.config.subsystem == "http"
+local string= string
+local io= io
+local package   = package
+local new_tab   = base.new_tab
+local ngx_timer_at  = ngx.timer.at
+local ffi   = require 'ffi'
+local C = ffi.C
+local router_config = ngx.shared["router-config"]
+
+local process
+if is_http then
+process = require("ngx.process")
+end
+
+
+ffi.cdef[[
+extern void CreateMock(void* writeRoute);
+]]
+
+
+local _M = {
+version = 0.1,
+local_conf = config_local.local_conf,
+}
+
+
+-- todo: refactor this function in chash.lua and radixtree.lua
+local function load_shared_lib(lib_name)
+local string_gmatch = string.gmatch
+local string_match = string.match
+local io_open = io.open
+local io_close = io.close
+
+local cpath = package.cpath
+local tried_paths = new_tab(32, 0)
+local i = 1
+
+for k, _ in string_gmatch(cpath, "[^;]+") do
+local fpath = string_match(k, "(.*/)")
+fpath = fpath .. lib_name
+
+local f = io_open(fpath)
+if f ~= nil then
+io_close(f)
+return ffi.load(fpath)
+end
+tried_paths[i] = fpath
+i = i + 1
+end
+
+return nil, tried_paths
+end
+
+
+local function load_ameshagent(lib_name)
+ngx_timer_at(0, function(premature)
+if premature then
+return
+end
+
+local ameshagent, tried_paths = load_shared_lib(lib_name)
+
+if not ameshagent then
+tried_paths[#tried_paths + 1] = 'tried above paths but can not 
load '
+.. lib_name
+error("can not load amesh agent, tried paths: " ..
+table.concat(tried_paths, '\r\n', 1, #tried_paths))
+end
+
+local router_zone = 
C.ngx_http_lua_ffi_shdict_udata_to_zone(router_config[1])
+local router_shd_cdata = ffi.cast("void*", router_zone)
+ameshagent.CreateMock(router_shd_cdata)
+end)
+end
+
+
+
+function _M.init_worker()
+local lib_name = "libameshagent"

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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tzssangglass commented on a change in pull request #6614: feat: support reading configuration form shdict(mvp)

2022-03-15 Thread GitBox


tzssangglass commented on a change in pull request #6614:
URL: https://github.com/apache/apisix/pull/6614#discussion_r826967583



##
File path: apisix/core/config_shdict.lua
##
@@ -0,0 +1,126 @@
+--
+-- 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.
+--
+
+--- Get configuration form ngx.shared.DICT.
+--
+-- @module core.config_shdict
+
+local base  = require("resty.core.base")
+local config_local  = require("apisix.core.config_local")
+local table = table
+local is_http   = ngx.config.subsystem == "http"
+local string= string
+local io= io
+local package   = package
+local new_tab   = base.new_tab
+local ngx_timer_at  = ngx.timer.at
+local ffi   = require 'ffi'
+local C = ffi.C
+local router_config = ngx.shared["router-config"]
+
+local process
+if is_http then
+process = require("ngx.process")
+end
+
+
+ffi.cdef[[
+extern void CreateMock(void* writeRoute);
+]]
+
+
+local _M = {
+version = 0.1,
+local_conf = config_local.local_conf,
+}
+
+
+-- todo: refactor this function in chash.lua and radixtree.lua
+local function load_shared_lib(lib_name)
+local string_gmatch = string.gmatch
+local string_match = string.match
+local io_open = io.open
+local io_close = io.close
+
+local cpath = package.cpath
+local tried_paths = new_tab(32, 0)
+local i = 1
+
+for k, _ in string_gmatch(cpath, "[^;]+") do
+local fpath = string_match(k, "(.*/)")
+fpath = fpath .. lib_name
+
+local f = io_open(fpath)
+if f ~= nil then
+io_close(f)
+return ffi.load(fpath)
+end
+tried_paths[i] = fpath
+i = i + 1
+end
+
+return nil, tried_paths
+end
+
+
+local function load_ameshagent(lib_name)
+ngx_timer_at(0, function(premature)
+if premature then
+return
+end
+
+local ameshagent, tried_paths = load_shared_lib(lib_name)
+
+if not ameshagent then
+tried_paths[#tried_paths + 1] = 'tried above paths but can not 
load '
+.. lib_name
+error("can not load amesh agent, tried paths: " ..
+table.concat(tried_paths, '\r\n', 1, #tried_paths))
+end
+
+local router_zone = 
C.ngx_http_lua_ffi_shdict_udata_to_zone(router_config[1])

Review comment:
   `router_config` type is `table`
   `router_config[1]` type is `userdata`
   `router_zone ` type is `cdata`
   
   use `ngx_http_lua_ffi_shdict_udata_to_zone` here it is for passing pointer 
variables(`cdata`) to Amesh
   




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] starsz commented on a change in pull request #2152: feat: added dashboard backend api for apisix status summary

2022-03-15 Thread GitBox


starsz commented on a change in pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#discussion_r827016768



##
File path: api/internal/handler/overview/overview.go
##
@@ -0,0 +1,250 @@
+/*
+ * 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.
+ */
+package overview
+
+import (
+   "reflect"
+   "sort"
+
+   "github.com/gin-gonic/gin"
+   "github.com/shiningrush/droplet"
+   "github.com/shiningrush/droplet/wrapper"
+   wgin "github.com/shiningrush/droplet/wrapper/gin"
+
+   "github.com/apisix/manager-api/internal/conf"
+   "github.com/apisix/manager-api/internal/core/entity"
+   "github.com/apisix/manager-api/internal/core/store"
+   "github.com/apisix/manager-api/internal/handler"
+   "github.com/apisix/manager-api/internal/utils"
+)
+
+type Handler struct {
+   routeStore  store.Interface
+   upstreamStore   store.Interface
+   serverInfoStore store.Interface
+   serviceStorestore.Interface
+   sslStorestore.Interface
+}
+
+func NewHandler() (handler.RouteRegister, error) {
+   return &Handler{
+   routeStore:  store.GetStore(store.HubKeyRoute),
+   upstreamStore:   store.GetStore(store.HubKeyUpstream),
+   serverInfoStore: store.GetStore(store.HubKeyServerInfo),
+   serviceStore:store.GetStore(store.HubKeyService),
+   sslStore:store.GetStore(store.HubKeySsl),
+   }, nil
+}
+
+func (h *Handler) ApplyRoute(r *gin.Engine) {
+   r.GET("/apisix/admin/overview", wgin.Wraps(h.List,
+   wrapper.InputType(reflect.TypeOf(ListInput{}
+}
+
+type ListInput struct {
+}
+
+func (h *Handler) List(c droplet.Context) (interface{}, error) {
+   routerCnt, onlineRouterCnt, err := h.GetRouteCnt(c)
+   if err != nil {
+   return nil, err
+   }
+
+   upstreamCnt, err := h.GetUpstreamCnt(c)
+   if err != nil {
+   return nil, err
+   }
+
+   serviceCnt, err := h.GetServiceCnt(c)
+   if err != nil {
+   return nil, err
+   }
+
+   certificateCnt, err := h.GetCertificateCnt(c)
+   if err != nil {
+   return nil, err
+   }
+
+   plugins, err := h.GetPlugins(c)
+   if err != nil {
+   return nil, err
+   }
+
+   dashboardVersion, err := h.GetApisixVersion()
+   if err != nil {
+   return nil, err
+   }
+
+   serverInfo, err := h.GetServerInfo(c)
+   if err != nil {
+   return nil, err
+   }
+
+   res := &entity.Overview{
+   RouteCnt: routerCnt,
+   OnlineRouterCnt:  onlineRouterCnt,
+   UpstreamCnt:  upstreamCnt,
+   ServiceCnt:   serviceCnt,
+   CertificateCnt:   certificateCnt,
+   DashboardVersion: dashboardVersion,
+   GatewayInfo:  serverInfo,
+   Plugins:  plugins,
+   }
+
+   return res, nil
+}
+
+func (h *Handler) GetCertificateCnt(c droplet.Context) (int64, error) {
+   var certificateCnt int64 = 0
+
+   certificateRet, err := h.sslStore.List(c.Context(), store.ListInput{
+   Predicate: func(obj interface{}) bool {
+   return true
+   },
+   PageSize:   0,
+   PageNumber: 0,
+   })
+
+   if err == nil {
+   certificateCnt = int64(certificateRet.TotalSize)
+   }
+
+   return certificateCnt, err
+}
+
+func (h *Handler) GetPlugins(_ droplet.Context) ([]string, error) {
+
+   plugins := conf.Schema.Get("plugins")
+
+   var res []string
+   list := plugins.Value().(map[string]interface{})
+   for name := range list {
+   res = append(res, name)
+   }
+   sort.Strings(res)
+
+   return res, nil
+}
+
+func (h *Handler) GetServerInfo(c droplet.Context) ([]*entity.ServerInfo, 
error) {
+   ret, err := h.serverInfoStore.List(c.Context(), store.ListInput{
+   Predicate: func(obj interface{}) bool {
+   return true
+   },
+   PageSize:   0,
+   PageNumber: 0

[GitHub] [apisix-dashboard] zaunist commented on pull request #2152: feat: added dashboard backend api for apisix status summary

2022-03-15 Thread GitBox


zaunist commented on pull request #2152:
URL: 
https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1068035223


   > > Hi Bozhong, `ready to review` has been set, I am actively monitoring 
this stream, so please let me know if there is any other blockage by making new 
comments.
   
   Thanks a lot @codewangg.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] shuaijinchao commented on issue #6604: chore: add semicolon check in `make lint`

2022-03-15 Thread GitBox


shuaijinchao commented on issue #6604:
URL: https://github.com/apache/apisix/issues/6604#issuecomment-1068038563


   > I think @shuaijinchao can write your solution first, although he may not 
be perfect. But it is also useful for others.
   
   Updated to topic
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] starsz commented on a change in pull request #6586: feat: add support for password grant in keycloak plugin

2022-03-15 Thread GitBox


starsz commented on a change in pull request #6586:
URL: https://github.com/apache/apisix/pull/6586#discussion_r827025532



##
File path: apisix/plugins/authz-keycloak.lua
##
@@ -695,8 +700,88 @@ local function fetch_jwt_token(ctx)
 return token
 end
 
+-- To get new access token by calling get token api
+local function generate_token_using_password_grant(conf,ctx)
+log.debug("generate_token_using_password_grant Function Called")
+
+local body, err = core.request.get_body()
+if err or not body then
+log.error("Failed to get request body: ", err)
+return 503
+end
+local parameters = ngx.decode_args(body)
+
+local username = parameters["username"]
+local password = parameters["password"]
+
+if not username then
+local err = "username is missing."
+log.error(err)
+return 422, err
+end
+if not password then
+local err = "password is missing."
+log.error(err)
+return 422, err
+end
+
+local client_id = authz_keycloak_get_client_id(conf)
+
+local token_endpoint = authz_keycloak_get_token_endpoint(conf)
+
+if not token_endpoint then
+local err = "Unable to determine token endpoint."
+log.error(err)
+return 500, err
+end
+local httpc = authz_keycloak_get_http_client(conf)
+
+local params = {
+method = "POST",
+body =  ngx.encode_args({
+grant_type = "password",
+client_id = client_id,
+client_secret = conf.client_secret,
+username = username,
+password = password
+}),
+headers = {
+["Content-Type"] = "application/x-www-form-urlencoded"
+}
+}
+
+params = authz_keycloak_configure_params(params, conf)
+
+local res, err = httpc:request_uri(token_endpoint, params)
+
+if not res then
+err = "Accessing token endpoint URL (" .. token_endpoint
+  .. ") failed: " .. err
+log.error(err)
+return 401, {message = err}
+end
+
+log.debug("Response data: " .. res.body)
+local json, err = authz_keycloak_parse_json_response(res)
+
+if not json then
+err = "Could not decode JSON from response"
+  .. (err and (": " .. err) or '.')
+log.error(err)
+return 401, {message = err}
+end
+
+return res.status, res.body
+end
 
 function _M.access(conf, ctx)
+
+if conf.password_grant_token_generation_incoming_uri and
+ngx.var.request_uri:upper() ==
+conf.password_grant_token_generation_incoming_uri:upper() and
+ctx.curr_req_matched["_method"]:upper() == "POST" then

Review comment:
   `ctx.curr_req_matched["_method"]:upper()` looks strange.
   I think you can use `core.req.get_method` instead.

##
File path: docs/en/latest/plugins/authz-keycloak.md
##
@@ -122,6 +123,27 @@ of the same name. The scope is then added to every 
permission to check.
 If `lazy_load_paths` is `false`, the plugin adds the mapped scope to any of 
the static permissions configured
 in the `permissions` attribute, even if they contain one or more scopes 
already.
 
+### Password Grant Token Generation Incoming URI
+
+If you want to generate a token using `password` grant, you can set value of 
`password_grant_token_generation_incoming_uri`.
+
+Incoming request URI will be matched with this value and if matched, it will 
generate token using `Token Endpoint`.
+It will also check, if REST method is `POST`.

Review comment:
   ```suggestion
   It will also check if the request method is `POST`.
   ```

##
File path: apisix/plugins/authz-keycloak.lua
##
@@ -695,8 +700,88 @@ local function fetch_jwt_token(ctx)
 return token
 end
 
+-- To get new access token by calling get token api
+local function generate_token_using_password_grant(conf,ctx)
+log.debug("generate_token_using_password_grant Function Called")
+
+local body, err = core.request.get_body()
+if err or not body then
+log.error("Failed to get request body: ", err)
+return 503
+end
+local parameters = ngx.decode_args(body)
+
+local username = parameters["username"]
+local password = parameters["password"]
+
+if not username then
+local err = "username is missing."
+log.error(err)
+return 422, err
+end
+if not password then
+local err = "password is missing."
+log.error(err)
+return 422, err
+end
+
+local client_id = authz_keycloak_get_client_id(conf)
+
+local token_endpoint = authz_keycloak_get_token_endpoint(conf)
+
+if not token_endpoint then
+local err = "Unable to determine token endpoint."
+log.error(err)
+return 500, err
+end
+local httpc = authz_keycloak_get_http_client(conf)
+
+local params = {
+method = "POST",
+body =  ngx.encode_args({
+grant_type = "password",
+ 

[GitHub] [apisix] fatihbm closed pull request #6596: feat: Changing the limit-count plugin allow_degradation parameter default value to true.

2022-03-15 Thread GitBox


fatihbm closed pull request #6596:
URL: https://github.com/apache/apisix/pull/6596


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] fatihbm commented on issue #6595: feat: Changing the limit-count plugin allow_degradation parameter default value to true.

2022-03-15 Thread GitBox


fatihbm commented on issue #6595:
URL: https://github.com/apache/apisix/issues/6595#issuecomment-1068090302


   > Normally we can't accept a break change, even turning false to true by 
default.
   
   We decided to automate this in our ci/cd processes.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] fatihbm closed issue #6595: feat: Changing the limit-count plugin allow_degradation parameter default value to true.

2022-03-15 Thread GitBox


fatihbm closed issue #6595:
URL: https://github.com/apache/apisix/issues/6595


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] fatihbm opened a new pull request #6621: docs: Grammar fixes for the PR template.

2022-03-15 Thread GitBox


fatihbm opened a new pull request #6621:
URL: https://github.com/apache/apisix/pull/6621


   ### Description
   
   
   
   
   Fixes # (issue)
   
   ### Checklist
   
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added in this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backwards compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] hf400159 commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


hf400159 commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827057155



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。
+
+这个插件具备将多个指标组成一个批处理,一起推送给外部 Datadog 
代理的能力,且重复使用同一个数据报套接字。如果你没有收到日志数据,不要担心,给它一些时间。在我们批处理程序中的定时器功能到期后,它会自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。   
 |
+| constant_tags | array | optional| [ "source:apisix" ] |  | 
嵌入到生成指标中的静态标签。这对某些信号度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name   | StatsD Type   | Description   |
+| ---   | ---   | ---   |
+| Request Counter   | Counter   | No of requests received.   |
+| Request Latency   | Histogram | 处理该请求所需的时间(以毫秒为单位)。 |
+| Upstream latency  | Histogram | 代理请求到上游服务器直到收到响应所需的时间(以毫秒为单位)。 |
+| APISIX Latency| Histogram | APISIX 代理处理该请求的时间(以毫秒为单位)。|
+| Ingress Size  | Timer | 以字节为单位的请求体大小。 |
+| Egress Size   | Timer | 以字节为单位的响应体大小。 |
+
+这些指标将被发送到带有以下标签的 DogStatsD 代理。
+
+> 如果一个标签没有合适的值,该标签将被直接省略。
+
+- **route_name**:在路由模式定义中指定的名称,如果不存在或插件属性 `prefer_name` 被设置为 `false`,它将回退成路由 
id 值。
+- **service_name**:如果一个路由是用服务的抽象概念创建的,特定的服务 name/id(基于插件的 `prefer_name` 
属性)将被使用。
+- **consumer**:如果路由有一个链接的消费者,消费者的用户名将被添加为一个标签。
+- **balancer_ip**:处理了当前请求的 Upstream 平衡器的IP。
+- **response_status**:HTTP 响应状态代码。
+- **scheme**:用于提出如 HTTP、gRPC、gRPCs 等请求的 Scheme。
+
+## 如何启用
+
+下面是一个例子,用于说明如何为一个特定的路由启用 datadog 插件。在此之前请确保你的 datadog 代理已经启动并运行。
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+  "plugins": {
+"datadog": {}
+   },
+  "upstream": {
+   "type": "roundrobin",
+   "nodes": {
+   "127.0.0.1:1980": 1
+   }
+  },
+  "uri": "/hello"
+}'
+```
+
+现在,任何对 uri `/hello` 的请求都会生成上述指标并推送到 Datadog 代理的DogStatsD 服务器。
+
+## 禁用插件
+
+删除插件配置中相应的 json 配置以禁用 `datadog`。
+APISIX 插件是支持热加载的,所以不用重新启动配置也能生效。
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+"methods": ["GET"],
+"uri": "/hello",
+"plugins": {},
+"upstream": {
+"type": "roundrobin",
+"nodes": {
+"127.0.0.1:1980": 1
+}
+}
+}'
+```
+
+## 自定义配置
+
+在默认配置中,该插件希望 dogstatsd 服务在 `127.0.0.1:8125` 可用。如果你想更新配置,请更新插件的元数据。要了解更多关于 
datadog 元数据的字段,请参阅[这里](#元数据)。
+
+向 _/apisix/admin/plugin_metadata_ 端点发出请求,更新后的元数据如下。
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/plugin_metadata/datadog -H 
'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+"host": "172.168.45.29",
+"port": 8126,
+"constant_tags": [
+"source:apisix",
+"service:custom"
+],
+"namespace": "apisix"
+}'
+```
+
+这个 HTTP PUT 请求将更新元数

[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2370: feat: add page reload judgment

2022-03-15 Thread GitBox


codecov-commenter edited a comment on pull request #2370:
URL: 
https://github.com/apache/apisix-dashboard/pull/2370#issuecomment-1062618024


   # 
[Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2370?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#2370](https://codecov.io/gh/apache/apisix-dashboard/pull/2370?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (d8fd44b) into 
[master](https://codecov.io/gh/apache/apisix-dashboard/commit/561ed377ec2237707bb8c78623e336360c6c6463?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (561ed37) will **increase** coverage by `0.21%`.
   > The diff coverage is `92.85%`.
   
   > :exclamation: Current head d8fd44b differs from pull request most recent 
head 2bfb532. Consider uploading reports for the commit 2bfb532 to get more 
accurate results
   
   ```diff
   @@Coverage Diff @@
   ##   master#2370  +/-   ##
   ==
   + Coverage   68.52%   68.73%   +0.21% 
   ==
 Files 131  131  
 Lines3419 3426   +7 
 Branches  826  829   +3 
   ==
   + Hits 2343 2355  +12 
   + Misses   1076 1071   -5 
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | frontend-e2e-test | `68.73% <92.85%> (+0.21%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click 
here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment)
 to find out more.
   
   | [Impacted 
Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2370?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[web/src/pages/Consumer/components/Step1.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2370/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9jb21wb25lbnRzL1N0ZXAxLnRzeA==)
 | `100.00% <ø> (ø)` | |
   | 
[web/src/pages/Consumer/Create.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2370/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9DcmVhdGUudHN4)
 | `82.69% <50.00%> (ø)` | |
   | 
[web/src/pages/Route/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2370/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9MaXN0LnRzeA==)
 | `83.63% <85.71%> (+0.60%)` | :arrow_up: |
   | 
[web/src/hooks/usePagination.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/2370/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9ob29rcy91c2VQYWdpbmF0aW9uLnRz)
 | `100.00% <100.00%> (ø)` | |
   | 
[web/src/pages/Consumer/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2370/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9MaXN0LnRzeA==)
 | `91.66% <100.00%> (+3.09%)` | :arrow_up: |
   | 
[web/src/pages/Proto/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2370/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Qcm90by9MaXN0LnRzeA==)
 | `100.00% <100.00%> (+3.84%)` | :arrow_up: |
   | 
[...pages/Route/components/Step1/MatchingRulesView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2370/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL01hdGNoaW5nUnVsZXNWaWV3LnRzeA==)
 | `75.00% <100.00%> (+0.26%)` | :arrow_up: |
   | 
[web/src/pages/Route/transform.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/2370/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS90cmFuc2Zvcm0udHM=)
 | `78.30% <100.00%> (+0.52%)` | :a

[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827132679



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。
+
+这个插件具备将多个指标组成一个批处理,一起推送给外部 Datadog 
代理的能力,且重复使用同一个数据报套接字。如果你没有收到日志数据,不要担心,给它一些时间。在我们批处理程序中的定时器功能到期后,它会自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。   
 |
+| constant_tags | array | optional| [ "source:apisix" ] |  | 
嵌入到生成指标中的静态标签。这对某些信号度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name   | StatsD Type   | Description   |
+| ---   | ---   | ---   |
+| Request Counter   | Counter   | No of requests received.   |

Review comment:
   Excellent explanation, and my deepest thanks to you!
   In fact, my puzzle is `No`.
   And your explanation meets my want.
   And then I'm going to change `No` to `Number`.
   Thanks again.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827140031



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。

Review comment:
   LGTM.
   Solved it.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827141841



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。

Review comment:
   Solved.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827146325



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。
+
+这个插件具备将多个指标组成一个批处理,一起推送给外部 Datadog 
代理的能力,且重复使用同一个数据报套接字。如果你没有收到日志数据,不要担心,给它一些时间。在我们批处理程序中的定时器功能到期后,它会自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。   
 |
+| constant_tags | array | optional| [ "source:apisix" ] |  | 
嵌入到生成指标中的静态标签。这对某些信号度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name   | StatsD Type   | Description   |
+| ---   | ---   | ---   |
+| Request Counter   | Counter   | No of requests received.   |
+| Request Latency   | Histogram | 处理该请求所需的时间(以毫秒为单位)。 |
+| Upstream latency  | Histogram | 代理请求到上游服务器直到收到响应所需的时间(以毫秒为单位)。 |
+| APISIX Latency| Histogram | APISIX 代理处理该请求的时间(以毫秒为单位)。|
+| Ingress Size  | Timer | 以字节为单位的请求体大小。 |
+| Egress Size   | Timer | 以字节为单位的响应体大小。 |
+
+这些指标将被发送到带有以下标签的 DogStatsD 代理。
+
+> 如果一个标签没有合适的值,该标签将被直接省略。
+
+- **route_name**:在路由模式定义中指定的名称,如果不存在或插件属性 `prefer_name` 被设置为 `false`,它将回退成路由 
id 值。
+- **service_name**:如果一个路由是用服务的抽象概念创建的,特定的服务 name/id(基于插件的 `prefer_name` 
属性)将被使用。
+- **consumer**:如果路由有一个链接的消费者,消费者的用户名将被添加为一个标签。
+- **balancer_ip**:处理了当前请求的 Upstream 平衡器的IP。
+- **response_status**:HTTP 响应状态代码。
+- **scheme**:用于提出如 HTTP、gRPC、gRPCs 等请求的 Scheme。
+
+## 如何启用
+
+下面是一个例子,用于说明如何为一个特定的路由启用 datadog 插件。在此之前请确保你的 datadog 代理已经启动并运行。
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+  "plugins": {
+"datadog": {}
+   },
+  "upstream": {
+   "type": "roundrobin",
+   "nodes": {
+   "127.0.0.1:1980": 1
+   }
+  },
+  "uri": "/hello"
+}'
+```
+
+现在,任何对 uri `/hello` 的请求都会生成上述指标并推送到 Datadog 代理的DogStatsD 服务器。
+
+## 禁用插件
+
+删除插件配置中相应的 json 配置以禁用 `datadog`。
+APISIX 插件是支持热加载的,所以不用重新启动配置也能生效。

Review comment:
   I don't think this tone is appropriate for a technical document, so I 
don't think it's a good idea to take this advice.
   Maybe it works for technical articles, technical blogs, things like that.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827148491



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。
+
+这个插件具备将多个指标组成一个批处理,一起推送给外部 Datadog 
代理的能力,且重复使用同一个数据报套接字。如果你没有收到日志数据,不要担心,给它一些时间。在我们批处理程序中的定时器功能到期后,它会自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。   
 |
+| constant_tags | array | optional| [ "source:apisix" ] |  | 
嵌入到生成指标中的静态标签。这对某些信号度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name   | StatsD Type   | Description   |
+| ---   | ---   | ---   |
+| Request Counter   | Counter   | No of requests received.   |
+| Request Latency   | Histogram | 处理该请求所需的时间(以毫秒为单位)。 |
+| Upstream latency  | Histogram | 代理请求到上游服务器直到收到响应所需的时间(以毫秒为单位)。 |
+| APISIX Latency| Histogram | APISIX 代理处理该请求的时间(以毫秒为单位)。|
+| Ingress Size  | Timer | 以字节为单位的请求体大小。 |
+| Egress Size   | Timer | 以字节为单位的响应体大小。 |
+
+这些指标将被发送到带有以下标签的 DogStatsD 代理。
+
+> 如果一个标签没有合适的值,该标签将被直接省略。
+
+- **route_name**:在路由模式定义中指定的名称,如果不存在或插件属性 `prefer_name` 被设置为 `false`,它将回退成路由 
id 值。
+- **service_name**:如果一个路由是用服务的抽象概念创建的,特定的服务 name/id(基于插件的 `prefer_name` 
属性)将被使用。
+- **consumer**:如果路由有一个链接的消费者,消费者的用户名将被添加为一个标签。
+- **balancer_ip**:处理了当前请求的 Upstream 平衡器的IP。
+- **response_status**:HTTP 响应状态代码。
+- **scheme**:用于提出如 HTTP、gRPC、gRPCs 等请求的 Scheme。
+
+## 如何启用
+
+下面是一个例子,用于说明如何为一个特定的路由启用 datadog 插件。在此之前请确保你的 datadog 代理已经启动并运行。
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '

Review comment:
   I looked at almost all of the documentation, and this is not a generic 
way to write it. 
   I don't recommend that we improve this command in this PR.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827149222



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。
+
+这个插件具备将多个指标组成一个批处理,一起推送给外部 Datadog 
代理的能力,且重复使用同一个数据报套接字。如果你没有收到日志数据,不要担心,给它一些时间。在我们批处理程序中的定时器功能到期后,它会自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。   
 |
+| constant_tags | array | optional| [ "source:apisix" ] |  | 
嵌入到生成指标中的静态标签。这对某些信号度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name   | StatsD Type   | Description   |
+| ---   | ---   | ---   |
+| Request Counter   | Counter   | No of requests received.   |
+| Request Latency   | Histogram | 处理该请求所需的时间(以毫秒为单位)。 |
+| Upstream latency  | Histogram | 代理请求到上游服务器直到收到响应所需的时间(以毫秒为单位)。 |
+| APISIX Latency| Histogram | APISIX 代理处理该请求的时间(以毫秒为单位)。|
+| Ingress Size  | Timer | 以字节为单位的请求体大小。 |
+| Egress Size   | Timer | 以字节为单位的响应体大小。 |
+
+这些指标将被发送到带有以下标签的 DogStatsD 代理。
+
+> 如果一个标签没有合适的值,该标签将被直接省略。
+
+- **route_name**:在路由模式定义中指定的名称,如果不存在或插件属性 `prefer_name` 被设置为 `false`,它将回退成路由 
id 值。
+- **service_name**:如果一个路由是用服务的抽象概念创建的,特定的服务 name/id(基于插件的 `prefer_name` 
属性)将被使用。
+- **consumer**:如果路由有一个链接的消费者,消费者的用户名将被添加为一个标签。
+- **balancer_ip**:处理了当前请求的 Upstream 平衡器的IP。
+- **response_status**:HTTP 响应状态代码。
+- **scheme**:用于提出如 HTTP、gRPC、gRPCs 等请求的 Scheme。
+
+## 如何启用
+
+下面是一个例子,用于说明如何为一个特定的路由启用 datadog 插件。在此之前请确保你的 datadog 代理已经启动并运行。
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+  "plugins": {
+"datadog": {}
+   },
+  "upstream": {
+   "type": "roundrobin",
+   "nodes": {
+   "127.0.0.1:1980": 1
+   }
+  },
+  "uri": "/hello"
+}'
+```
+
+现在,任何对 uri `/hello` 的请求都会生成上述指标并推送到 Datadog 代理的DogStatsD 服务器。
+
+## 禁用插件
+
+删除插件配置中相应的 json 配置以禁用 `datadog`。
+APISIX 插件是支持热加载的,所以不用重新启动配置也能生效。
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '

Review comment:
   Same as above.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827149666



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。
+
+这个插件具备将多个指标组成一个批处理,一起推送给外部 Datadog 
代理的能力,且重复使用同一个数据报套接字。如果你没有收到日志数据,不要担心,给它一些时间。在我们批处理程序中的定时器功能到期后,它会自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。   
 |
+| constant_tags | array | optional| [ "source:apisix" ] |  | 
嵌入到生成指标中的静态标签。这对某些信号度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name   | StatsD Type   | Description   |
+| ---   | ---   | ---   |
+| Request Counter   | Counter   | No of requests received.   |
+| Request Latency   | Histogram | 处理该请求所需的时间(以毫秒为单位)。 |
+| Upstream latency  | Histogram | 代理请求到上游服务器直到收到响应所需的时间(以毫秒为单位)。 |
+| APISIX Latency| Histogram | APISIX 代理处理该请求的时间(以毫秒为单位)。|
+| Ingress Size  | Timer | 以字节为单位的请求体大小。 |
+| Egress Size   | Timer | 以字节为单位的响应体大小。 |
+
+这些指标将被发送到带有以下标签的 DogStatsD 代理。
+
+> 如果一个标签没有合适的值,该标签将被直接省略。
+
+- **route_name**:在路由模式定义中指定的名称,如果不存在或插件属性 `prefer_name` 被设置为 `false`,它将回退成路由 
id 值。
+- **service_name**:如果一个路由是用服务的抽象概念创建的,特定的服务 name/id(基于插件的 `prefer_name` 
属性)将被使用。
+- **consumer**:如果路由有一个链接的消费者,消费者的用户名将被添加为一个标签。
+- **balancer_ip**:处理了当前请求的 Upstream 平衡器的IP。
+- **response_status**:HTTP 响应状态代码。
+- **scheme**:用于提出如 HTTP、gRPC、gRPCs 等请求的 Scheme。
+
+## 如何启用
+
+下面是一个例子,用于说明如何为一个特定的路由启用 datadog 插件。在此之前请确保你的 datadog 代理已经启动并运行。
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+  "plugins": {
+"datadog": {}
+   },
+  "upstream": {
+   "type": "roundrobin",
+   "nodes": {
+   "127.0.0.1:1980": 1
+   }
+  },
+  "uri": "/hello"
+}'
+```
+
+现在,任何对 uri `/hello` 的请求都会生成上述指标并推送到 Datadog 代理的DogStatsD 服务器。
+
+## 禁用插件
+
+删除插件配置中相应的 json 配置以禁用 `datadog`。
+APISIX 插件是支持热加载的,所以不用重新启动配置也能生效。
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+"methods": ["GET"],
+"uri": "/hello",
+"plugins": {},
+"upstream": {
+"type": "roundrobin",
+"nodes": {
+"127.0.0.1:1980": 1
+}
+}
+}'
+```
+
+## 自定义配置
+
+在默认配置中,该插件希望 dogstatsd 服务在 `127.0.0.1:8125` 可用。如果你想更新配置,请更新插件的元数据。要了解更多关于 
datadog 元数据的字段,请参阅[这里](#元数据)。
+
+向 _/apisix/admin/plugin_metadata_ 端点发出请求,更新后的元数据如下。
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/plugin_metadata/datadog -H 
'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '

Review comment:
   Same as above.




-- 
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 

[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827149666



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。
+
+这个插件具备将多个指标组成一个批处理,一起推送给外部 Datadog 
代理的能力,且重复使用同一个数据报套接字。如果你没有收到日志数据,不要担心,给它一些时间。在我们批处理程序中的定时器功能到期后,它会自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。   
 |
+| constant_tags | array | optional| [ "source:apisix" ] |  | 
嵌入到生成指标中的静态标签。这对某些信号度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name   | StatsD Type   | Description   |
+| ---   | ---   | ---   |
+| Request Counter   | Counter   | No of requests received.   |
+| Request Latency   | Histogram | 处理该请求所需的时间(以毫秒为单位)。 |
+| Upstream latency  | Histogram | 代理请求到上游服务器直到收到响应所需的时间(以毫秒为单位)。 |
+| APISIX Latency| Histogram | APISIX 代理处理该请求的时间(以毫秒为单位)。|
+| Ingress Size  | Timer | 以字节为单位的请求体大小。 |
+| Egress Size   | Timer | 以字节为单位的响应体大小。 |
+
+这些指标将被发送到带有以下标签的 DogStatsD 代理。
+
+> 如果一个标签没有合适的值,该标签将被直接省略。
+
+- **route_name**:在路由模式定义中指定的名称,如果不存在或插件属性 `prefer_name` 被设置为 `false`,它将回退成路由 
id 值。
+- **service_name**:如果一个路由是用服务的抽象概念创建的,特定的服务 name/id(基于插件的 `prefer_name` 
属性)将被使用。
+- **consumer**:如果路由有一个链接的消费者,消费者的用户名将被添加为一个标签。
+- **balancer_ip**:处理了当前请求的 Upstream 平衡器的IP。
+- **response_status**:HTTP 响应状态代码。
+- **scheme**:用于提出如 HTTP、gRPC、gRPCs 等请求的 Scheme。
+
+## 如何启用
+
+下面是一个例子,用于说明如何为一个特定的路由启用 datadog 插件。在此之前请确保你的 datadog 代理已经启动并运行。
+
+```shell
+curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+  "plugins": {
+"datadog": {}
+   },
+  "upstream": {
+   "type": "roundrobin",
+   "nodes": {
+   "127.0.0.1:1980": 1
+   }
+  },
+  "uri": "/hello"
+}'
+```
+
+现在,任何对 uri `/hello` 的请求都会生成上述指标并推送到 Datadog 代理的DogStatsD 服务器。
+
+## 禁用插件
+
+删除插件配置中相应的 json 配置以禁用 `datadog`。
+APISIX 插件是支持热加载的,所以不用重新启动配置也能生效。
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
+{
+"methods": ["GET"],
+"uri": "/hello",
+"plugins": {},
+"upstream": {
+"type": "roundrobin",
+"nodes": {
+"127.0.0.1:1980": 1
+}
+}
+}'
+```
+
+## 自定义配置
+
+在默认配置中,该插件希望 dogstatsd 服务在 `127.0.0.1:8125` 可用。如果你想更新配置,请更新插件的元数据。要了解更多关于 
datadog 元数据的字段,请参阅[这里](#元数据)。
+
+向 _/apisix/admin/plugin_metadata_ 端点发出请求,更新后的元数据如下。
+
+```shell
+$ curl http://127.0.0.1:9080/apisix/admin/plugin_metadata/datadog -H 
'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '

Review comment:
   Same as above.
   I have removed '$', Thanks.

##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+##

[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827154739



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是一个内置于 Apache APISIX 的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云计算应用最常用的监控和观察平台之一)无缝集成。如果启用,这个插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本上反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(要了解更多关于如何安装 Datadog 
代理,请访问[这里](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的一个实现,它为 Apache APISIX 代理收集自定义指标,并将其聚合成一个数据点,发送到配置的 Datadog 服务器。要了解更多关于 
DogStatsD 的信息,请访问 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 文档。
+
+这个插件具备将多个指标组成一个批处理,一起推送给外部 Datadog 
代理的能力,且重复使用同一个数据报套接字。如果你没有收到日志数据,不要担心,给它一些时间。在我们批处理程序中的定时器功能到期后,它会自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。   
 |
+| constant_tags | array | optional| [ "source:apisix" ] |  | 
嵌入到生成指标中的静态标签。这对某些信号度量进行分组很有用。 |
+
+要了解更多关于如何有效地编写标签,请访问[这里](https://docs.datadoghq.com/getting_started/tagging/#defining-tags)
+
+## 输出指标
+
+Apache APISIX 代理,对于每个请求响应周期,如果启用了 datadog 插件,就会向 DogStatsD 服务器输出以下指标。
+
+| Metric Name   | StatsD Type   | Description   |
+| ---   | ---   | ---   |
+| Request Counter   | Counter   | No of requests received.   |
+| Request Latency   | Histogram | 处理该请求所需的时间(以毫秒为单位)。 |
+| Upstream latency  | Histogram | 代理请求到上游服务器直到收到响应所需的时间(以毫秒为单位)。 |
+| APISIX Latency| Histogram | APISIX 代理处理该请求的时间(以毫秒为单位)。|
+| Ingress Size  | Timer | 以字节为单位的请求体大小。 |
+| Egress Size   | Timer | 以字节为单位的响应体大小。 |
+
+这些指标将被发送到带有以下标签的 DogStatsD 代理。
+
+> 如果一个标签没有合适的值,该标签将被直接省略。
+
+- **route_name**:在路由模式定义中指定的名称,如果不存在或插件属性 `prefer_name` 被设置为 `false`,它将回退成路由 
id 值。
+- **service_name**:如果一个路由是用服务的抽象概念创建的,特定的服务 name/id(基于插件的 `prefer_name` 
属性)将被使用。
+- **consumer**:如果路由有一个链接的消费者,消费者的用户名将被添加为一个标签。
+- **balancer_ip**:处理了当前请求的 Upstream 平衡器的IP。
+- **response_status**:HTTP 响应状态代码。
+- **scheme**:用于提出如 HTTP、gRPC、gRPCs 等请求的 Scheme。
+
+## 如何启用
+
+下面是一个例子,用于说明如何为一个特定的路由启用 datadog 插件。在此之前请确保你的 datadog 代理已经启动并运行。

Review comment:
   Solved.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] bisakhmondal commented on a change in pull request #6619: docs: Correct grammar in PR template

2022-03-15 Thread GitBox


bisakhmondal commented on a change in pull request #6619:
URL: https://github.com/apache/apisix/pull/6619#discussion_r827288134



##
File path: .github/PULL_REQUEST_TEMPLATE.md
##
@@ -8,21 +8,21 @@ Fixes # (issue)
 ### Checklist
 
 - [ ] I have explained the need for this PR and the problem it solves
-- [ ] I have explained the changes or the new features added in this PR
+- [ ] I have explained the changes or the new features added to this PR
 - [ ] I have added tests corresponding to this change
 - [ ] I have updated the documentation to reflect this change
-- [ ] I have verified that this change is backwards compatible (If not, please 
discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
+- [ ] I have verified that this change is backward compatible (If not, please 
discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
 
 

[GitHub] [apisix] moonming commented on pull request #6621: docs: Grammar fixes for the PR template.

2022-03-15 Thread GitBox


moonming commented on pull request #6621:
URL: https://github.com/apache/apisix/pull/6621#issuecomment-1068583644


   the same as https://github.com/apache/apisix/pull/6619?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] moonming commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


moonming commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827511608



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是 Apache APISIX 内置的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云应用最常用的监控和可观测性平台之一)无缝集成。`datadog` 
插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(关于如何安装 Datadog 
代理,请参考[Agent](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的实现,它将收集到的 Apache APISIX 代理的自定义指标聚合成单个数据点,并发送到设置的 Datadog 服务器上。更多关于 DogStatsD 
的信息,请参考 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 。

Review comment:
   `Datadog 代理` -> `Datadog Agent`
   

##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是 Apache APISIX 内置的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云应用最常用的监控和可观测性平台之一)无缝集成。`datadog` 
插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(关于如何安装 Datadog 
代理,请参考[Agent](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的实现,它将收集到的 Apache APISIX 代理的自定义指标聚合成单个数据点,并发送到设置的 Datadog 服务器上。更多关于 DogStatsD 
的信息,请参考 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 。
+
+`datadog` 插件具有将多个指标组成一个批处理并统一推送给外部 Datadog 
代理的能力,并且可以重复使用同一个数据报套接字。如果没有收到日志数据,请耐心等待,它会在批处理程序中的定时器功能到期后自动发送日志。

Review comment:
   `数据报套接字` -> `数据包套接字`

##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是 Apache APISIX 内置的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云应用最常用的监控和可观测性平台之一)无缝集成。`datadog` 
插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(关于如何安装 Datadog 
代理,请参考[Agent](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的实现,它将收集到的 Apache APISIX 代理的自定义指标聚合成单个数据点,并发送到设置的 Datadog 服务器上。更多关于 DogStatsD 
的信息,请参考 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 。
+
+`datadog` 插件具有将多个指标组成一个批处理并统一推送给外部 Datadog 
代理的能力,并且可以重复使用同一个数据报套接字。如果没有收到日志数据,请耐心等待,它会在批处理程序中的定时器功能到期后自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |

Review comment:
   `度量` don't understand what it means

##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是 Apache APISIX 内置的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云应用最常用的监控和可观测性平台之一)无缝集成。`datadog` 
插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(关于如何安装 Datadog 
代理,请参考[Agent](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的实现,它将收集到的 Apache APISIX 代理的自定义指标聚合成单个数据点,并发送到设置的 Datadog 服务器上。更多关于 DogStatsD 
的信息,请参考 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 。
+
+`datadog` 插件具有将多个指标组成一个批处理并统一推送给外部 Datadog 
代理的能力,并且可以重复使用同一个数据报套接字。如果没有收到日志数据,请耐心等待,它会在批处理程序中的定时器功能到期后自动发送日志。
+
+关于 Apache APISIX 的批处理程序的更多信息,请参考 [Batch-Processor](../batch-processor.md#配置)
+
+## 属性
+
+| 名称 | 类型   | 必选项  | 默认值  | 有效值   | 描述 
   |
+| ---  | -- | ---  | ---  | -   | 

   |
+| prefer_name  | boolean | optional| true | true/false  | 
如果设置为 "false",将使用路由/服务的 ID,而不是带有度量标签的名称(默认)。   |
+
+该插件支持使用批处理程序来聚集和处理条目(日志/数据)的批次。这就避免了插件频繁地提交数据,默认情况下,批处理程序每 `5` 秒或当队列中的数据达到 
`1000` 时提交数据。有关信息或自定义批处理程序的参数设置,请参阅[批处理程序](../batch-processor.md#configuration) 
配置部分。
+
+## 元数据
+
+| 名称| 类型| 必选项 | 默认值| 有效值 | 描述  
  |
+| --- | --  | --- |  ---   | - | 
-- |
+| host| string  | optional|  "127.0.0.1"   |   | 
DogStatsD 服务器的主机地址  |
+| port| integer | optional|8125|   | 
DogStatsD服务器的主机端口 |
+| namespace   | string  | optional|"apisix"|   | 
由APISIX代理发送的所有自定义度量的前缀。对寻找指标图的实体很有帮助,例如:(apisix.request.counter)。 

[GitHub] [apisix] moonming commented on pull request #6615: fix(log-rotate): log rotate time align

2022-03-15 Thread GitBox


moonming commented on pull request #6615:
URL: https://github.com/apache/apisix/pull/6615#issuecomment-1068599615


   @shuaijinchao please do NOT directly copy and paste other people's 
PR(https://github.com/apache/apisix/pull/6521) without discussing and reaching 
a consensus with other contributors.
   I closed this PR. Please help @snowdusk to write test cases of 
https://github.com/apache/apisix/pull/6521


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] moonming closed pull request #6615: fix(log-rotate): log rotate time align

2022-03-15 Thread GitBox


moonming closed pull request #6615:
URL: https://github.com/apache/apisix/pull/6615


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] Chever-John commented on a change in pull request #6616: docs: add datadog document(zh)

2022-03-15 Thread GitBox


Chever-John commented on a change in pull request #6616:
URL: https://github.com/apache/apisix/pull/6616#discussion_r827520333



##
File path: docs/zh/latest/plugins/datadog.md
##
@@ -0,0 +1,145 @@
+---
+title: datadog
+---
+
+
+
+## 简介
+
+`datadog` 是 Apache APISIX 内置的监控插件,可与 
[Datadog](https://www.datadoghq.com/)(云应用最常用的监控和可观测性平台之一)无缝集成。`datadog` 
插件支持对每个请求和响应周期进行多种指标参数的获取,这些指标参数基本反映了系统的行为和健康状况。
+
+该插件通过 UDP 协议将其自定义指标推送给 DogStatsD 服务器,该服务器与 Datadog 代理捆绑在一起(关于如何安装 Datadog 
代理,请参考[Agent](https://docs.datadoghq.com/agent/) )。DogStatsD 基本上是 StatsD 
协议的实现,它将收集到的 Apache APISIX 代理的自定义指标聚合成单个数据点,并发送到设置的 Datadog 服务器上。更多关于 DogStatsD 
的信息,请参考 
[DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent) 。

Review comment:
   Got it.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on issue #6602: request help: real_ip_recursive for real-ip plugin

2022-03-15 Thread GitBox


tokers commented on issue #6602:
URL: https://github.com/apache/apisix/issues/6602#issuecomment-1068619853


   > > @crazyMonkey1995 Would you like to try it?
   > 
   > Okay, but maybe not so soon.
   
   Thanks!
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[apisix-ingress-controller] branch master updated: docs: merge contribute.md and development.md (#909)

2022-03-15 Thread zhangjintao
This is an automated email from the ASF dual-hosted git repository.

zhangjintao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
 new f31f520  docs: merge contribute.md and development.md (#909)
f31f520 is described below

commit f31f5201100169a61cd6b8220683453f2f81379d
Author: bin-ya <81069633+bin...@users.noreply.github.com>
AuthorDate: Wed Mar 16 09:04:57 2022 +0800

docs: merge contribute.md and development.md (#909)
---
 README.md |  15 -
 docs/en/latest/contribute.md  | 108 +
 docs/en/latest/development.md | 124 --
 docs/en/latest/getting-started.md |   2 +-
 4 files changed, 111 insertions(+), 138 deletions(-)

diff --git a/README.md b/README.md
index 781e777..25189f7 100644
--- a/README.md
+++ b/README.md
@@ -89,7 +89,6 @@ From the version 1.0.0, APISIX-ingress-controller need to 
work with Apache APISI
 ## Documents
 
 * [Get Started](./docs/en/latest/getting-started.md)
-* [SDK doc](./docs/en/latest/development.md)
 * [Design introduction](./docs/en/latest/design.md)
 
 ## FAQ
@@ -123,6 +122,20 @@ We welcome all kinds of contributions from the open-source 
community, individual
 * Ingress APISIX: the whole service that contains the proxy ([Apache 
APISIX](https://apisix.apache.org)) and ingress controller (apisix ingress 
controller).
 * apisix-ingress-controller: the ingress controller component.
 
+## How to contribute
+
+Most of the contributions that we receive are code contributions, but you can
+also contribute to the documentation or simply report solid bugs
+for us to fix.
+
+ For new contributors, please take a look at issues with a tag called [Good 
first 
issue](https://github.com/apache/apisix-ingress-controller/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
 or [Help 
wanted](https://github.com/apache/apisix-ingress-controller/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22).
+
+## How to report a bug
+
+* **Ensure the bug was not already reported** by searching on GitHub under 
[Issues](https://github.com/apache/apisix-ingress-controller/issues).
+
+* If you're unable to find an open issue addressing the problem, [open a new 
one](https://github.com/apache/apisix-ingress-controller/issues/new). Be sure 
to include a **title and clear description**, as much relevant information as 
possible, and a **code sample** or an **executable test case** demonstrating 
the expected behavior that is not occurring.
+
 ## License
 
 [Apache License 
2.0](https://github.com/apache/apisix-ingress-controller/blob/master/LICENSE)
diff --git a/docs/en/latest/contribute.md b/docs/en/latest/contribute.md
index fa861ee..c3dec73 100644
--- a/docs/en/latest/contribute.md
+++ b/docs/en/latest/contribute.md
@@ -1,5 +1,5 @@
 ---
-title: Contributing to apisix-ingress-controller
+title: Developing for Apache APISIX Ingress Controller
 ---
 
 
 
-Firstly, thanks for your interest in contributing! I hope that this will be a
-pleasant first experience for you, and that you will return to continue
-contributing.
+This document explains how to get started with developing for Apache APISIX 
Ingress controller.
 
-## How to contribute
+## Prerequisites
 
-Most of the contributions that we receive are code contributions, but you can
-also contribute to the documentation or simply report solid bugs
-for us to fix.
+* Install [Go 1.13](https://golang.org/dl/) or later, and we use go module to 
manage the go package dependencies.
+* Prepare an available Kubernetes cluster in your workstation, we recommend 
you to use [KIND](https://kind.sigs.k8s.io/).
+* Install Apache APISIX in Kubernetes by [Helm 
Chart](https://github.com/apache/apisix-helm-chart).
 
- For new contributors, please take a look at issues with a tag called [Good 
first 
issue](https://github.com/apache/apisix-ingress-controller/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
 or [Help 
wanted](https://github.com/apache/apisix-ingress-controller/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22).
+## Fork and Clone
 
-## How to report a bug
+* Fork the repository from 
[apache/apisix-ingress-controller](https://github.com/apache/apisix-ingress-controller)
 to your own GitHub account.
+* Clone the fork repository to your workstation.
+* Run `go mod download` to download modules to local cache. By the way, if you 
are a developer in China, we suggest you setting `GOPROXY` to 
`https://goproxy.cn` to speed up the downloading.
 
-* **Ensure the bug was not already reported** by searching on GitHub under 
[Issues](https://github.com/apache/apisix-ingress-controller/issues).
+## Build
 
-* If you're unable to find an open issue addressing the problem, [open a new 
one](https://github.com/apache/apisix-ingress-controller/issues/new). Be sure 
to include a **title and clear des

[GitHub] [apisix-ingress-controller] tao12345666333 closed issue #905: docs: merge contribute.md and development.md

2022-03-15 Thread GitBox


tao12345666333 closed issue #905:
URL: https://github.com/apache/apisix-ingress-controller/issues/905


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-ingress-controller] tao12345666333 merged pull request #909: docs: merge contribute.md and development.md

2022-03-15 Thread GitBox


tao12345666333 merged pull request #909:
URL: https://github.com/apache/apisix-ingress-controller/pull/909


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on issue #6620: bug: return internal server error for http request

2022-03-15 Thread GitBox


tokers commented on issue #6620:
URL: https://github.com/apache/apisix/issues/6620#issuecomment-1068622929


   > function _M.api()
   return {
   {
   methods = {"GET"},
   uris = {"/v1/plugin/example-plugin/hello"},
   handler = hello,
   }
   }
   end
   
   Please read the document carefully, it's not `uris` but `uri`.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] rpei2022 opened a new pull request #6622: improve fetch_api_router

2022-03-15 Thread GitBox


rpei2022 opened a new pull request #6622:
URL: https://github.com/apache/apisix/pull/6622


   ### Description
   
   
   
   
   Fixes # (issue)
   
   ### Checklist
   
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added in this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backwards compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)
   
   
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] Baoyuantop commented on a change in pull request #2347: feat: Merge path hostname input box

2022-03-15 Thread GitBox


Baoyuantop commented on a change in pull request #2347:
URL: https://github.com/apache/apisix-dashboard/pull/2347#discussion_r827536473



##
File path: web/src/pages/Upstream/Create.tsx
##
@@ -44,6 +44,14 @@ const Page: React.FC = (props) => {
   }
 }
 
+if (newData?.checks?.active) {
+  const host = newData?.checks?.active.host;
+  const http_path = newData?.checks?.active.http_path;
+  const url = host + http_path;
+  newData.checks.active.url = url;

Review comment:
   Better to use template literals.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on issue #6580: feat: Redesign the architecture of the plugin system

2022-03-15 Thread GitBox


tokers commented on issue #6580:
URL: https://github.com/apache/apisix/issues/6580#issuecomment-1068626201


   > Imagine the user has defined a Service with plugin A and priority 5. Now, 
they define a route with plugin B and C.
   > 
   > How would you compute the order based on the array?
   
   That's tricky. We may think about another way to allow a plugin can be run 
multiple times but still use the object to store their config. I'm wondering if 
there are some circumstances that people want to run the same plugin in a 
single route but not continuously (e.g. run plugin A, plugin B, plugin A). 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] rpei2022 commented on issue #6620: bug: return internal server error for http request

2022-03-15 Thread GitBox


rpei2022 commented on issue #6620:
URL: https://github.com/apache/apisix/issues/6620#issuecomment-1068627069


   > > function _M.api()
   > > return {
   > > {
   > > methods = {"GET"},
   > > uris = {"/v1/plugin/example-plugin/hello"},
   > > handler = hello,
   > > }
   > > }
   > > end
   > 
   > Please read the document carefully, it's not `uris` but `uri`.
   
   I just copy the code in  the example-plugin.lua, because example-plugin.lua 
has the following code, could you explain the difference?
   function _M.control_api()
   return {
   {
   methods = {"GET"},
   uris = {"/v1/plugin/example-plugin/hello"},
   handler = hello,
   }
   }
   end
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on issue #6580: feat: Redesign the architecture of the plugin system

2022-03-15 Thread GitBox


tokers commented on issue #6580:
URL: https://github.com/apache/apisix/issues/6580#issuecomment-1068627411


   > > Imagine the user has defined a Service with plugin A and priority 5. 
Now, they define a route with plugin B and C.
   > > How would you compute the order based on the array?
   > 
   > That's tricky. We may think about another way to allow a plugin can be run 
multiple times but still use the object to store their config. I'm wondering if 
there are some circumstances that people want to run the same plugin in a 
single route but not continuously (e.g. run plugin A, plugin B, plugin A).
   
   If not, what about the following way:
   
   ```json
   {
   "uri": "/api/*",
   "host": "foo.com",
  "plugins": {
  "limit-count": [
 {
"time_window": 60,
"count": 10,
"key": "remote_addr"
 },
 {
"time_window": 1,
"count": 5,
"key": "route_id"
 }
  ] 
   }
   }
   
   ```


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] tokers commented on issue #6620: bug: return internal server error for http request

2022-03-15 Thread GitBox


tokers commented on issue #6620:
URL: https://github.com/apache/apisix/issues/6620#issuecomment-1068628191


   > > > function _M.api()
   > > > return {
   > > > {
   > > > methods = {"GET"},
   > > > uris = {"/v1/plugin/example-plugin/hello"},
   > > > handler = hello,
   > > > }
   > > > }
   > > > end
   > > 
   > > 
   > > Please read the document carefully, it's not `uris` but `uri`.
   > 
   > Thanks for your reply, I just copy the code in the example-plugin.lua and 
make small change(change the function name), because example-plugin.lua has the 
following code, could you explain the difference? function _M.control_api() 
return { { methods = {"GET"}, uris = {"/v1/plugin/example-plugin/hello"}, 
handler = hello, } } end
   
   I think it's a bug in the example-plugin, welcome to fix it.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] rpei2022 edited a comment on issue #6620: bug: return internal server error for http request

2022-03-15 Thread GitBox


rpei2022 edited a comment on issue #6620:
URL: https://github.com/apache/apisix/issues/6620#issuecomment-1068627069


   > > function _M.api()
   > > return {
   > > {
   > > methods = {"GET"},
   > > uris = {"/v1/plugin/example-plugin/hello"},
   > > handler = hello,
   > > }
   > > }
   > > end
   > 
   > Please read the document carefully, it's not `uris` but `uri`.
   
   Thanks for your reply, I just copy the code in  the example-plugin.lua and 
make small change(change the function name), because example-plugin.lua has the 
following code, could you explain the difference?
   function _M.control_api()
   return {
   {
   methods = {"GET"},
   uris = {"/v1/plugin/example-plugin/hello"},
   handler = hello,
   }
   }
   end
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix] liangliang4ward commented on issue #6580: feat: Redesign the architecture of the plugin system

2022-03-15 Thread GitBox


liangliang4ward commented on issue #6580:
URL: https://github.com/apache/apisix/issues/6580#issuecomment-1068628809


   > > > Imagine the user has defined a Service with plugin A and priority 5. 
Now, they define a route with plugin B and C.
   > > > How would you compute the order based on the array?
   > > 
   > > 
   > > That's tricky. We may think about another way to allow a plugin can be 
run multiple times but still use the object to store their config. I'm 
wondering if there are some circumstances that people want to run the same 
plugin in a single route but not continuously (e.g. run plugin A, plugin B, 
plugin A).
   > 
   > If not, what about the following way:
   > 
   > ```json
   > {
   > "uri": "/api/*",
   > "host": "foo.com",
   >"plugins": {
   >"limit-count": [
   >   {
   >  "time_window": 60,
   >  "count": 10,
   >  "key": "remote_addr"
   >   },
   >   {
   >  "time_window": 1,
   >  "count": 5,
   >  "key": "route_id"
   >   }
   >] 
   > }
   > }
   > ```
   
   It's that support something a little more flexible? For example, when 
hamc-auth supports `or` mode, multiple configurations?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




  1   2   >