Skip to content

Chart Links


Chart links enable data linkage, allowing you to navigate from the current chart to a target page and pass data.

When a JVM metric chart is grouped by service or runtime instance, click chart data to view related Profiling. This entry is provided by the system; no separate chart link configuration is required.

Variable Types

Four types of template variables are supported:

Time Variables

Tag Variables

View Variables

Value Variables

Time Variables

Variable
Description
#{TR} The time range of the current chart query. For example, if the query time is Last 1 hour, the template variable &time=#{TR} is equivalent to &time=1h
#{timestamp.start} The start time of the data point selected by the current chart query
#{timestamp.end} The end time of the data point selected by the current chart query
#{startTime} When time is not locked, the start time of the time widget in the upper-right corner of the chart; when time is locked, the start time of the locked time range
#{endTime} When time is not locked, the end time of the time widget in the upper-right corner of the chart; when time is locked, the end time of the locked time range
Note

During actual queries, you can use the time variables #{startTime} and #{endTime} and view variables as placeholders. The system replaces them based on the variable values in the global settings.

Tag Variables

Variable Description
#{T} The set of all grouping tags for the current chart query. For example, if the query is
M::'datakit':(LAST('cpu_usage')) BY 'host','os'
the query result is: host=abc, os=linux

then:
  • Template variable: &query=#{T} is equivalent to &query=host:abc os:linux
  • #{T.name} The value of a specific tag. For example, if the query is
    M::'datakit':(LAST('cpu_usage')) BY 'host', 'os'
    the query result is: host=abc, os=linux

    then:
  • Template variable #{T.host} = abc
    &query=hostname:#{T.host} is equivalent to &query=hostname:abc
  • View Variables

    Variable Description
    #{V} The set of all view variables in the current dashboard. For example, if the view variables are:
    version=V1.7.0 and region=cn-hangzhou

    then:
  • Template variable&query=#{V} is equivalent to &query=version:V1.7.0 region:cn-hangzhou
  • #{V.name} The value of a view variable in the current dashboard; name can be replaced with any variable name.
    Assume the view variable of the current dashboard is version=V1.7.0

    then:
  • Template variable #{V.version} = V1.7.0
  • &query=version:#{V.version} is equivalent to &query=version:V1.7.0
  • Value Variables

    Chart Type
    Variable
    Description
    Time Series Chart
    Overview Chart
    Pie Chart
    Bar Chart
    Top List
    Dashboard
    Funnel Chart
    #{Value} The data value variable returned by the current chart query. For example, if the query M::cpu:(AVG(load5s)) returns the result: AVG(load5s)=a

    then:
  • Value variable: &query=#{Value} is equivalent to &query=AVG(load5s):a
  • Scatter Chart #{Value.X} The X-axis data value variable returned by the current chart query. Assume the current chart query is:
    M::cpu:(AVG(load5s))
    the query result is: X:AVG(load5s)=abc

    then:
  • Value variable: &query=#{Value.X} is equivalent to &query=X:abc
  • #{Value.Y} The Y-axis data value variable returned by the current chart query. For example, if the query M::backuplog:(AVG(lru_add_cache_success_count))
    the query result is: Y:AVG(lru_add_cache_success_count)=dca

    then:
  • Value variable &query=Y:#{Value.Y} is equivalent to &query=Y:dca
  • Bubble Chart #{Value.X} The X-axis data value variable returned by the current chart query. For example, if the query T::RE(.*):(FIRST(duration)) BY service
    the query result is: X:first(duration)=98

    then:
  • Value variable: &query=X:#{Value.X} is equivalent to &query=X:98
  • #{Value.Y} The Y-axis data value variable returned by the current chart query. For example, if the query T::RE(.*):(LAST(duration)) BY service
    the query result is: Y:last(duration)=8500

    then:
  • Value variable &query=Y:#{Value.Y} is equivalent to &query=Y:8500
  • #{Value.Size} The Size data value variable returned by the current chart query. For example, if the query T::RE(.*):(MAX(duration)) BY service
    the query result is: Size:Max(duration)=1773

    then:
  • Value variable &query=Size:#{Value.Size} is equivalent to &query=Size:1773
  • Table Chart #{Value.column_name} The column value variable selected in the current chart; name can be replaced with any column variable name. For example, if the query L::RE(.*):(COUNT(*)) { index = default }
    the query result is: count(*)=40813

    then:
  • Value variable&query=#{Value.count(*)} is equivalent to &query=count(*):40813
  • Treemap Chart
    Honeycomb Chart
    World Map
    China Map
    #{Value.metric_name} The query data value variable selected in the current chart; name can be replaced with any column variable name. For example, if the query L::RE(.*):(MAX(response_time)) { index = default } BY country
    the query result is: max(response_time)=16692

    then:
  • Value variable&query=#{Value.max(response_time)} is equivalent to &query=max(response_time):16692
  • Feedback

    Is this page helpful?