Skip to content

View Variables


View variables are the core mechanism for implementing chart linkage filtering in Guance scenarios. They allow users to change the value of one or more view variables, enabling multiple charts to simultaneously respond to the same filtering conditions and update visualization results in real-time.

Scenario Comparison

❌ Without View Variables ✅ With View Variables
Viewing monitoring for Host A:

  • Go to the CPU chart, modify the query condition to host=A;

  • Go to the memory chart, modify the query condition to host=A;

  • Go to the disk chart, modify the query condition to host=A
  • Viewing monitoring for Host A: Select "Host A" from the top dropdown, all charts refresh automatically
    10 charts require 10 operations 10 charts require only 1 operation
    Team members modify individually, configurations can easily become messy Unified entry, centralized configuration management

    Core Logic

    As a global filter control at the top of the dashboard, its working principle is:

    1. Specify a variable name (e.g., host) and an optional value source (e.g., a list of all hosts);
    2. Insert the variable into chart queries using the #{host} syntax;
    3. After the user selects a value at the top, all charts referencing that variable refresh automatically.

    Create

    1. Variable Name: The name of the variable set to which the current view variable belongs. When adding charts to the dashboard, it needs to be referenced in the chart query, format: #{variable name};
    2. Display Name: The name displayed for the current view variable set in the dashboard, e.g., variable name is host, display name is Host Name;
    3. Query: Define the data source for optional values;
    4. Sort: Perform default, ascending, or descending sorting on the view variables returned by the query;
    5. Determine the Display Options;
    6. Default Value: The initial value of the current view variable in the dashboard. Based on your configuration in "Display Options", a dropdown lists variables, allowing you to select the initial value displayed by default in the dashboard. If the default value is empty, the dashboard displays the latest field data. Click Select All to select all values in the current list;
    7. Save.
    Note

    When workspace data is interrupted, fields can be preset in view variables; after data recovery, the system will automatically match them.

    Display Options

    Option Function Description Use Cases
    Hidden When enabled, this variable is not visible within the dashboard in non-edit mode Used to enforce fixed conditions, e.g., only allowing viewing of the production environment
    Multi-value Supports selecting multiple values simultaneously Enable when needing to compare multiple hosts
    Include * Enabled by default (❗️ When * is selected, the filtering condition for this variable is ignored, and charts display full data)
  • Ignore field filtering. The chart query will not include filtering conditions for this variable;
  • All variable values will be used as filtering conditions (supports up to 100 values). Too much data may affect performance, use as needed.
  • Enable when default viewing of full data is required

    Manage Variables

    In the view variable list, the following operations can be performed:

    • Clone: Copy the current variable configuration to quickly create similar variables;
    • Edit: Modify the variable's query logic, display options, etc.;
    • Delete: Remove this variable (charts that have referenced this variable will become invalid);
    • Hidden Indicator: Variables marked as hidden will display a hidden button.

    Further Reading

    Feedback

    Is this page helpful? ×