-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
KAFKA-18272: Deprecated protocol api usage should be logged at info level #18313
KAFKA-18272: Deprecated protocol api usage should be logged at info level #18313
Conversation
…evel This makes it possible to enable request logs for deprecated protocol api versions without enabling it for the rest. Combined with the ability to enable/disable dynamically, it makes it a bit easier to collect the information about deprecated clients that is not available via metrics.
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.
LGTM with one trivial comment
requestLogger.debug("Completed request:" + desc.toString) | ||
val logPrefix = "Completed request: {}" | ||
// log deprecated apis at `info` level to allow them to be selectively enabled | ||
if (header.apiKey().isVersionDeprecated(header.apiVersion())) |
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.
Perhaps we can add a helper method to header to directly check for deprecated versions, such as header.isVersionDeprecated()
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.
Good point, pushed a commit with this change.
…evel (#18313) This makes it possible to enable request logs for deprecated protocol api versions without enabling it for the rest. Combined with the ability to enable/disable dynamically, it makes it a bit easier to collect the information about deprecated clients that is not available via metrics. This isn't particularly useful in trunk/4.0 since there are no deprecated api versions in these versions, but it will be useful for older branches. I intend to backport to those branches and add a release note in the backport regarding the change in behavior. I manually verified that: 1. If the request logger is configured at `INFO` level, only deprecated protocol api versions are logged and they are logged at `INFO` level. 2. If the request logger is configured at `DEBUG` level, all requests are logged but the log level is `INFO` for deprecated protocol api versions and `DEBUG` for the rest. 3. If the request logger is configured at `WARN` level (the default), no requests are logged. Reviewers: Chia-Ping Tsai <[email protected]>
…evel (apache#18313) This makes it possible to enable request logs for deprecated protocol api versions without enabling it for the rest. Combined with the ability to enable/disable dynamically, it makes it a bit easier to collect the information about deprecated clients that is not available via metrics. This isn't particularly useful in trunk/4.0 since there are no deprecated api versions in these versions, but it will be useful for older branches. I intend to backport to those branches and add a release note in the backport regarding the change in behavior. I manually verified that: 1. If the request logger is configured at `INFO` level, only deprecated protocol api versions are logged and they are logged at `INFO` level. 2. If the request logger is configured at `DEBUG` level, all requests are logged but the log level is `INFO` for deprecated protocol api versions and `DEBUG` for the rest. 3. If the request logger is configured at `WARN` level (the default), no requests are logged. Reviewers: Chia-Ping Tsai <[email protected]>
…evel (apache#18313) This makes it possible to enable request logs for deprecated protocol api versions without enabling it for the rest. Combined with the ability to enable/disable dynamically, it makes it a bit easier to collect the information about deprecated clients that is not available via metrics. This isn't particularly useful in trunk/4.0 since there are no deprecated api versions in these versions, but it will be useful for older branches. I intend to backport to those branches and add a release note in the backport regarding the change in behavior. I manually verified that: 1. If the request logger is configured at `INFO` level, only deprecated protocol api versions are logged and they are logged at `INFO` level. 2. If the request logger is configured at `DEBUG` level, all requests are logged but the log level is `INFO` for deprecated protocol api versions and `DEBUG` for the rest. 3. If the request logger is configured at `WARN` level (the default), no requests are logged. Reviewers: Chia-Ping Tsai <[email protected]>
This makes it possible to enable request logs for deprecated protocol api versions without enabling it for the rest. Combined with the ability to enable/disable dynamically, it makes it a bit easier to collect the information about deprecated clients that is not available via metrics.
This isn't particularly useful in trunk/4.0 since there are no deprecated api versions in these versions, but it will be useful for older branches. I intend to backport to those branches and add a release note in the backport regarding the change in behavior.
I manually verified that:
INFO
level, only deprecated protocol api versions are logged and they are logged atINFO
level.DEBUG
level, all requests are logged but the log level isINFO
for deprecated protocol api versions andDEBUG
for the rest.WARN
level (the default), no requests are logged.Committer Checklist (excluded from commit message)