Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

咨询自定义监控不生效的问题 #206

Open
yu199195 opened this issue Apr 10, 2018 · 9 comments
Open

咨询自定义监控不生效的问题 #206

yu199195 opened this issue Apr 10, 2018 · 9 comments
Labels

Comments

@yu199195
Copy link

yu199195 commented Apr 10, 2018

针对Orange使用的提问, 对于简单几句话描述不清的问题, 请使用以下格式, 不符合格式或描述含糊不清的issue将不予回复。

描述你想实现的功能
使用自定义监控插件,对具体的访问请求做监控

使用的插件

montior

针对这个需求你使用了哪个或哪几个插件

  • 使用了montior插件
具体的配置

在插件里做了什么配置, 可以截图, 一定要描述清楚你的配置
image

期望的结果

自定义监控能够生效,能够看到请求的流量 qps等

错误的结果

2018/04/10 17:03:42 [error] 8568#8700: 2442 failed to run log_by_lua: .\orange\utils\condition.lua:113: API disabled in the context of log_by_lua*
stack traceback:
[C]: in function 'read_body'
.\orange\utils\condition.lua:113: in function 'judge'
.\orange\utils\judge.lua:58: in function 'filter_and_conditions'
.\orange\utils\judge.lua:117: in function 'judge_selector'
.\orange\plugins\monitor\handler.lua:73: in function 'log'
.\orange\orange.lua:234: in function 'log'
log_by_lua(nginx.conf:121):3: in function <log_by_lua(nginx.conf:121):1> while logging request, client: 127.0.0.1, server: , request: "POST / HTTP/1.1", upstream: "http://127.0.0.1:7999/", host: "localhost"
image

@yu199195
Copy link
Author

全局统计里面能够看到请求的访问量,以及qps等等

@yu199195
Copy link
Author

全局统计里面能够看到请求的访问量,以及qps等等

@yu199195 yu199195 reopened this Apr 10, 2018
@yu199195
Copy link
Author

在 condition.lua 的113行 ngx.req.read_body() 这句代码一直报错

@yu199195
Copy link
Author

作者在吗?是不是在log阶段,不能调用ngx.req.read_body() 来获取post参数

@sumory
Copy link
Collaborator

sumory commented Apr 10, 2018

ngx.req.read_body是不能用于log_by_lua的,如果要监控post请求流量的话可以把这个插件定义在content_by_lua阶段。你急用的话可以先手动调一下

@sumory sumory added the bug label Apr 10, 2018
@yu199195
Copy link
Author

好的,谢谢作者,那这个插件我应该是 重新写access 方法吧
作者方便添加下联系方式吗? 我们公司在线上的网关使用oranage,有问题能及时请假,thanks

@sumory
Copy link
Collaborator

sumory commented Apr 11, 2018

  • 如果log阶段做不了,可以在content_by_lua阶段做类似统计
  • 可以加入QQ群,522410959

@yu199195
Copy link
Author

已经满员,添加不了~~,清理下,,哈哈,有几个集群的问题,想请教下

@yrjjf
Copy link

yrjjf commented Jul 9, 2018

群满了,加入不了, 有问题想请教,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants