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

feat(log) add balancer tries and failure information #2429

Merged
merged 1 commit into from
Apr 21, 2017
Merged

Conversation

Tieske
Copy link
Member

@Tieske Tieske commented Apr 21, 2017

The number of tries will be logged in the basic serializer. If any retries occurred, then failure information will be added as well.

@Tieske Tieske self-assigned this Apr 21, 2017
@Tieske Tieske added this to the 0.10.2 milestone Apr 21, 2017
Copy link
Member

@bungle bungle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but could improve on code style. Not a blocker for sure.

kong/kong.lua Outdated
@@ -217,7 +217,12 @@ function Kong.balancer()
-- record failure data
addr.failures = addr.failures or {}
local state, code = get_last_failure()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move local state, code = get_last_failure() above addr.failures = addr.failures or {} it makes code more pleasing to read, :-).

kong/kong.lua Outdated
state = state,
code = code,
ip = addr.ip,
port = addr.port,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we start aligning equal = signs?

it("serializes the tries and failure information", function()
ngx.ctx.balancer_address.tries = 3
ngx.ctx.balancer_address.failures = {
{ state = "next", code = 502, ip = "127.0.0.1", port = 1234 },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some alignment could make it easier to read here as well.

The number of tries will be logged in the basic serializer.
If any retries occurred, then failure information will be added
as well.
Copy link
Member

@bungle bungle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done.

@Tieske Tieske merged commit a711145 into master Apr 21, 2017
@Tieske Tieske deleted the feat/log-tries branch April 21, 2017 13:01
@@ -31,6 +31,8 @@
configured log target-url includes credentials. Thanks to
[Amir M. Saeid](https://github.com/amir) for the contribution.
[#2430](https://github.com/Mashape/kong/pull/2430)
- Logging retries and failure information.
[#2429](https://github.com/Mashape/kong/pull/2429).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have went into the below section already having a "logging plugins" mention

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

Successfully merging this pull request may close these issues.

3 participants