Identifying old clients
Introduction
In Kafka 4, several deprecated older clients and API protocol versions are no longer supported and have been removed. In order for clients not to run into issues after the upgrade, operators can verify that a Kafka cluster no longer receives any of these removed API calls.
How to identify old clients
Metrics
The Kafka cluster exposes metrics to find these deprecated calls. These metrics are produced under the name kafka_network_requestmetrics_deprecatedrequests_total. Labels in these metrics contain some more information regarding connected clients.
Logs
Setting the logger kafka.request.logger to INFO will log any deprecated request that goes to the broker. This will appear in json format in the logs. For example
{
"isForwarded": false,
"requestHeader": {
"requestApiKey": 2,
"requestApiVersion": 0,
"correlationId": 2,
"clientId": "rdkafka",
"requestApiKeyName": "LIST_OFFSETS",
"requestApiVersionDeprecated": true
},
"request": {...},
"response": {...},
"connection": "...",
"securityProtocol": "SSL",
"principal": "User:...",
"listener": "...",
"clientInformation": {
"softwareName": "confluent-kafka-dotnet",
"softwareVersion": "1.7.0"
}
}
By monitoring the Kafka request logs, any deprecated client request can be identified and traced back to a specific user principal and specific software (client version) being used.