-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
style(clustering): add some useful CP/DP logs #13885
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Sanskar Jaiswal <[email protected]>
@@ -101,7 +101,7 @@ local function send_ping(c, log_suffix) | |||
"unable to send ping frame to control plane: ", err, log_suffix) | |||
|
|||
else | |||
ngx_log(ngx_DEBUG, _log_prefix, "sent ping frame to control plane", log_suffix) | |||
ngx_log(ngx_DEBUG, _log_prefix, "sent ping frame to control plane with hash: ", hash, log_suffix) |
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.
should we only log this once per hash and not per ping.
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.
just to confirm you mean we could log the new hash only after we process the reconfigure event and update the declarative config? in that case, yes we could do that as well.
but this log line also gives us a good idea of the dataplane's configuration state. furthermore, it's not really adding a new log statement but merely appending a few bytes to an existing log statement.
Signed-off-by: Sanskar Jaiswal <[email protected]>
dd0a3c2
to
803dac2
Compare
@@ -90,7 +90,7 @@ function _M.connect_cp(dp, endpoint, protocols) | |||
wss_proxy_authorization = proxy_opts.proxy_authorization, | |||
} | |||
|
|||
ngx_log(ngx_DEBUG, _log_prefix, | |||
ngx_log(ngx_INFO, _log_prefix, |
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.
same here, only log when we receive different hash.
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.
i'm not familiar with the gateway, so please correct me if i'm wrong. this function is used to open a new connection to the controplane, which is unrelated to receiving a new hash?
Summary
Add the config hash in the log statement while sending a ping to the controlplane. This enables us to see which hash the gateway was using at a particular moment in time, consequently helping us figure out for how long did gateway run with a stale configuration.
Update the log that records a new CP connection to the INFO level, since it can provide useful into its connection with the controlplane. I don't think it is chatty enough to cause a problem when its being logged at this level.
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
Fix #[issue number]