How to obtain client information with Tanzu for Valkey
search cancel

How to obtain client information with Tanzu for Valkey

book

Article ID: 442469

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

Operator would like to monitor metrics and client information for the product Tanzu for Valkey on Tanzu Platform.

Operator has questions on tracking historical client data and associating these clients with specific application using Tanzu Valkey.

Environment

Product: Tanzu for Valkey on Tanzu Platform

Resolution

The Tanzu Valkey service emits metrics on the number of connected clients. This document details this metrics and how to monitor them.

The Valkey CLI has a CLIENT LIST  command that can be used to list active clients. The CLIENT LIST command returns information and statistics about the client connections server in a mostly human readable format.

Historical client information is not maintained by service instance. An operator need to scrape this data over time and compile historical data in order to achieve this.

For tracking individual apps, the best option is to use CLIENT SETNAME to associate known clients with their applications.  

By default, standard connections share the same default identifiers, which can make it hard to tell which client belongs to which app. An operator can programmatically assign custom names to individual application connections using CLIENT SETNAME in your app code: 
CLIENT SETNAME my-custom-app-name
Once set, my-custom-app-name will appear under the name= field in your CLIENT LIST output, allowing you to monitor and manage individual application connections easily.