All Products
Search
Document Center

ApsaraMQ for Kafka:Query client IP addresses

Last Updated:Mar 10, 2026

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 scopeDescription
By InstanceAll client IPs connected to the instance
By TopicClient IPs that produce or consume messages on a specific topic
By GroupClient 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.

Important

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

  1. Log on to the ApsaraMQ for Kafka console.

  2. In the Resource Distribution section of the Overview page, select the region where your instance resides.

  3. In the left-side navigation pane, click Instances.

  4. On the Instances page, click the name of the target instance.

  5. In the left-side navigation pane, click Client IP Address Query.

  6. 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.

    Client IP Address Query tabs

    Sample query result

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.