Tanzu Valkey: Setting up Grafana dashboards for Shared VMs
search cancel

Tanzu Valkey: Setting up Grafana dashboards for Shared VMs

book

Article ID: 449588

calendar_today

Updated On:

Products

VMware Tanzu Data Services

Issue/Introduction

 

This article focuses on setting up a Grafana panel for a KPI metric that involves calculations as opposed to directly rendering the metrics. The example here shows how to display used memory as a percent of max memory, and assumes some familiarity with navigating Grafana via Healthwatch.

Environment

All Supported Tanzu Valkey versions

Resolution

Step 1: Set Up Query A (Used Memory)

Add a Grafana panel, and switch to "Edit" mode.

  • Toggle the query mode to Builder.
  • Leave the Metric dropdown empty.
  • Under Label filters, add:

Label: name

Operator: =~

Value: p_redis_shared_vm.*_info_memory_used_memory

Click the Eye icon next to Query A to hide raw values from the chart.

Step 2: Set Up Query B (Max Memory)


Click + Add query to create Query B in Builder mode.

  • Under Label filters, add:

Label: name

Operator: =~

Value: p_redis_shared_vm.*_info_memory_maxmemory

Click the Eye icon next to Query B to hide raw values from the chart.

Step 3: Add Transformations


Go to the Transform data tab.

Click Add transformation > Calculate math expression:

Mode: Binary operation

Left side: A

Operator: /

Right side: B

Alias: Fraction

Click the Eye icon on this transformation step to hide the intermediate decimal result.

Click Add transformation > Calculate math expression again:

Mode: Binary operation

Left side: Fraction (or select the first transformation output)

Operator: *

Right side: 100

Alias: Leave completely blank.

Step 4: Configure Display Settings


In the right sidebar under Standard options:

Set Unit to Misc > Percent (0-100).

Clear the Display name box entirely so individual instance GUIDs are preserved in the legend.

(Optional) Set Min to 0 and Max to 100.

Under Legend, set Visibility to On.

Additional Information


Leaving the Display name field blank in panel settings is required to prevent Grafana from overwriting individual instance GUID labels in the legend.

Ensure that the final transformation (* 100) has its visibility toggled ON.