When troubleshooting connectivity issues or tracking message consumption on your ApsaraMQ for Kafka instance, you need to know which clients are connected. The client IP address query feature samples broker API request logs and displays the IP addresses, ports, and connection counts of clients that send or receive messages during a specified time period.
How it works
ApsaraMQ for Kafka collects client connection data by sampling the API request logs that clients send to the broker.
Three query scopes are available:
| Query scope | Description |
|---|---|
| By Instance | All client IPs connected to the instance |
| By Topic | Client IPs that produce or consume messages on a specific topic |
| By Group | Client IPs associated with a specific consumer group |
The Statistics column in the query results shows the number of connections on different ports for a given IP address during the selected time period.
Make sure your broker runs the latest minor version. Older minor versions may produce inaccurate sampled logs, which leads to inaccurate IP data. To upgrade, see Minor version updates.
Query client IPs in the console
Log on to the ApsaraMQ for Kafka console.
In the Resource Distribution section of the Overview page, select the region where your instance resides.
In the left-side navigation pane, click Instances.
On the Instances page, click the name of the target instance.
In the left-side navigation pane, click Client IP Address Query.
Select the By Instance, By Topic, or By Group tab based on the scope of your query. The query results display a table with the following information:
Client IP address -- The IP address of the connected client.
Port -- The port used for the connection.
Statistics -- The number of connections on different ports for this IP address during the selected time period.


Common use cases
Diagnose high traffic on a topic: Use the By Topic tab to identify which client IPs generate the most connections on a specific topic.
Track consumer group activity: Use the By Group tab to verify which clients are actively consuming messages and detect any disconnected consumers.
Audit unexpected connections: Use the By Instance tab to review all connected client IPs and spot unrecognized addresses.