Skip to content

dashboard

grafonnet.dashboard

Subpackages

Index

Fields

fn new

new(title)

PARAMETERS:

  • title (string)

Creates a new dashboard with a title.

fn withAnnotations

withAnnotations(value)

PARAMETERS:

  • value (array)

withAnnotations adds an array of annotations to a dashboard.

This function appends passed data to existing values

fn withAnnotationsMixin

withAnnotationsMixin(value)

PARAMETERS:

  • value (array)

withAnnotationsMixin adds an array of annotations to a dashboard.

This function appends passed data to existing values

fn withDescription

withDescription(value)

PARAMETERS:

  • value (string)

Description of dashboard.

fn withEditable

withEditable(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

Whether a dashboard is editable or not.

fn withFiscalYearStartMonth

withFiscalYearStartMonth(value=0)

PARAMETERS:

  • value (integer)
    • default value: 0

The month that the fiscal year starts on. 0 = January, 11 = December

withLinks(value)

PARAMETERS:

  • value (array)

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

withLinks takes an array of link objects.

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/'),
])

fn withLinksMixin

withLinksMixin(value)

PARAMETERS:

  • value (array)

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

withLinks takes an array of link objects.

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/'),
])

fn withLiveNow

withLiveNow(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

When set to true, the dashboard will redraw panels at an interval matching the pixel width. This will keep data "moving left" regardless of the query refresh rate. This setting helps avoid dashboards presenting stale live data

fn withPanels

withPanels(panels, setPanelIDs=true)

PARAMETERS:

  • panels (array)
  • setPanelIDs (bool)
    • default value: true

withPanels sets the panels on a dashboard authoratively. It automatically adds IDs to the panels, this can be disabled with setPanelIDs=false.

fn withPanelsMixin

withPanelsMixin(panels, setPanelIDs=true)

PARAMETERS:

  • panels (array)
  • setPanelIDs (bool)
    • default value: true

withPanelsMixin adds more panels to a dashboard.

fn withRefresh

withRefresh(value)

PARAMETERS:

  • value (string)

Refresh rate of dashboard. Represented via interval string, e.g. "5s", "1m", "1h", "1d".

fn withSchemaVersion

withSchemaVersion(value=39)

PARAMETERS:

  • value (number)
    • default value: 39

fn withTags

withTags(value)

PARAMETERS:

  • value (array)

Tags associated with dashboard.

fn withTagsMixin

withTagsMixin(value)

PARAMETERS:

  • value (array)

Tags associated with dashboard.

fn withTemplating

withTemplating(value)

PARAMETERS:

  • value (object)

Configured template variables

fn withTemplatingMixin

withTemplatingMixin(value)

PARAMETERS:

  • value (object)

Configured template variables

fn withTimezone

withTimezone(value="browser")

PARAMETERS:

  • value (string)
    • default value: "browser"

Timezone of dashboard. Accepted values are IANA TZDB zone ID or "browser" or "utc".

fn withTitle

withTitle(value)

PARAMETERS:

  • value (string)

Title of dashboard.

fn withUid

withUid(value)

PARAMETERS:

  • value (string)

Unique dashboard identifier that can be generated by anyone. string (8-40)

fn withVariables

withVariables(value)

PARAMETERS:

  • value (array)

withVariables adds an array of variables to a dashboard

fn withVariablesMixin

withVariablesMixin(value)

PARAMETERS:

  • value (array)

withVariablesMixin adds an array of variables to a dashboard.

This function appends passed data to existing values

fn withWeekStart

withWeekStart(value)

PARAMETERS:

  • value (string)

Day when the week starts. Expressed by the name of the day in lowercase, e.g. "monday".

obj graphTooltip

fn graphTooltip.withSharedCrosshair

graphTooltip.withSharedCrosshair()

Share crosshair on all panels.

fn graphTooltip.withSharedTooltip

graphTooltip.withSharedTooltip()

Share crosshair and tooltip on all panels.

obj time

fn time.withFrom

time.withFrom(value="now-6h")

PARAMETERS:

  • value (string)
    • default value: "now-6h"

fn time.withTo

time.withTo(value="now")

PARAMETERS:

  • value (string)
    • default value: "now"

obj timepicker

fn timepicker.withHidden

timepicker.withHidden(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

Whether timepicker is visible or not.

fn timepicker.withNowDelay

timepicker.withNowDelay(value)

PARAMETERS:

  • value (string)

Override the now time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values.

fn timepicker.withRefreshIntervals

timepicker.withRefreshIntervals(value=["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"])

PARAMETERS:

  • value (array)
    • default value: ["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"]

Interval options available in the refresh picker dropdown.

fn timepicker.withRefreshIntervalsMixin

timepicker.withRefreshIntervalsMixin(value=["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"])

PARAMETERS:

  • value (array)
    • default value: ["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"]

Interval options available in the refresh picker dropdown.

fn timepicker.withTimeOptions

timepicker.withTimeOptions(value=["5m","15m","1h","6h","12h","24h","2d","7d","30d"])

PARAMETERS:

  • value (array)
    • default value: ["5m","15m","1h","6h","12h","24h","2d","7d","30d"]

Selectable options available in the time picker dropdown. Has no effect on provisioned dashboard.

fn timepicker.withTimeOptionsMixin

timepicker.withTimeOptionsMixin(value=["5m","15m","1h","6h","12h","24h","2d","7d","30d"])

PARAMETERS:

  • value (array)
    • default value: ["5m","15m","1h","6h","12h","24h","2d","7d","30d"]

Selectable options available in the time picker dropdown. Has no effect on provisioned dashboard.