-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Use async-http in monitor plugin #2447
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
Use async-http in monitor plugin #2447
Conversation
|
Hmm... async doesn't support 2.2 or earlier but fluentd still supports these version in this year. |
|
The smart way is http helper implements compatibility layer. |
72084c2 to
c8f751b
Compare
|
I did the former way! c8f751b |
|
Hi, these patches seems to be reasonable for me. 👍 I have a nitpick question. |
Signed-off-by: Yuta Iwama <[email protected]>
with http server helper which is async base Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
becuase it does not support ruby version < 2.3 Signed-off-by: Yuta Iwama <[email protected]>
http is a bit ambiguous Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
c8f751b to
569257e
Compare
|
I'm going to add more tests later :) (So I changed this PR title into the one which starts with [WIP] ) |
569257e to
8611f67
Compare
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
8611f67 to
7947e54
Compare
|
Ready to be reviewed! @cosmo0920 @repeatedly could you review this? |
cosmo0920
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. 😄
These http_server plugin helper implementation is greater than I had thought. 😁
| end | ||
|
|
||
| def start(notify = nil) | ||
| @logger.debug("Start HTTP server listening #{@uri}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For debug, I want async-http in the log like below
Start async HTTP server listening #{@uri}"
| end | ||
|
|
||
| def start(notify = nil) | ||
| build_handler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.debug with Start webrick HTTP server listening
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4b48997 fixed
| render_json(resp, code: code, pretty_json: pretty_json) | ||
| end | ||
|
|
||
| def render_json(obj, code: 200, **opts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
render_json accepts only pretty_json so how about replace **opts with pretty_json: false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right 42fd38f
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
|
Thanks! |
|
@ganmacs Could you send the patch to add http_server article to gitbook? |
|
will do! |
WEBrick is no longer recommended for production use. We don't need this feature because it was for supporting Ruby < 2.3. (fluent#2447) Signed-off-by: Daijiro Fukuda <[email protected]>
**Which issue(s) this PR fixes**: * Partially Fixes #4648 **What this PR does / why we need it**: Make `http_server` plugin helper stop the fallback to WEBrick. WEBrick is no longer recommended for production use. We don't need this feature because it was for supporting Ruby < 2.3. (#2447) **Docs Changes**: https://docs.fluentd.org/plugin-helper-overview/api-plugin-helper-http_server => fluent/fluentd-docs-gitbook#575 **Release Note**: The same as the title. Signed-off-by: Daijiro Fukuda <[email protected]>
depends on #2424, last 2 commits are for this patch.
Which issue(s) this PR fixes:
no
What this PR does / why we need it:
in_monitor_agent: Replace webrick base HTTP server with async-http base HTTP server.
Simple benchmark: https://gist.github.com/ganmacs/3f7984930a3cd9109bfbb8a2ca5d6991
Docs Changes:
noAdd http_server helper document
Release Note:
monitor_agent uses async-http base HTTP server instead of webrick base HTTP server