Skip to content

link

Dashboard links are displayed at the top of the dashboard, these can either link to other dashboards or to external URLs.

The docs give a more comprehensive description.

Example:

local g = import 'g.libsonnet';
local link = g.dashboard.link;

g.dashboard.new('Title dashboard')
+ g.dashboard.withLinks([
  link.link.new('My title', 'https://wikipedia.org/'),
])

Index

Fields

obj dashboards

fn dashboards.new

dashboards.new(title, tags)

PARAMETERS:

  • title (string)
  • tags (array)

Create links to dashboards based on tags.

obj dashboards.options

fn dashboards.options.withAsDropdown
dashboards.options.withAsDropdown(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

If true, all dashboards links will be displayed in a dropdown. If false, all dashboards links will be displayed side by side. Only valid if the type is dashboards

fn dashboards.options.withIncludeVars
dashboards.options.withIncludeVars(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

If true, includes current template variables values in the link as query params

fn dashboards.options.withKeepTime
dashboards.options.withKeepTime(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

If true, includes current time range in the link as query params

fn dashboards.options.withTargetBlank
dashboards.options.withTargetBlank(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

If true, the link will be opened in a new tab

fn link.new

link.new(title, url)

PARAMETERS:

  • title (string)
  • url (string)

Create link to an arbitrary URL.

fn link.withIcon

link.withIcon(value)

PARAMETERS:

  • value (string)

Icon name to be displayed with the link

fn link.withTooltip

link.withTooltip(value)

PARAMETERS:

  • value (string)

Tooltip to display when the user hovers their mouse over it

obj link.options

fn link.options.withAsDropdown
link.options.withAsDropdown(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

If true, all dashboards links will be displayed in a dropdown. If false, all dashboards links will be displayed side by side. Only valid if the type is dashboards

fn link.options.withIncludeVars
link.options.withIncludeVars(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

If true, includes current template variables values in the link as query params

fn link.options.withKeepTime
link.options.withKeepTime(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

If true, includes current time range in the link as query params

fn link.options.withTargetBlank
link.options.withTargetBlank(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

If true, the link will be opened in a new tab