dashboard
grafonnet.dashboard
Subpackages
Index
fn new(title)
fn withAnnotations(value)
fn withAnnotationsMixin(value)
fn withDescription(value)
fn withEditable(value=true)
fn withFiscalYearStartMonth(value=0)
fn withLinks(value)
fn withLinksMixin(value)
fn withLiveNow(value=true)
fn withPanels(panels, setPanelIDs=true)
fn withPanelsMixin(panels, setPanelIDs=true)
fn withRefresh(value)
fn withSchemaVersion(value=39)
fn withTags(value)
fn withTagsMixin(value)
fn withTemplating(value)
fn withTemplatingMixin(value)
fn withTimezone(value="browser")
fn withTitle(value)
fn withUid(value)
fn withVariables(value)
fn withVariablesMixin(value)
fn withWeekStart(value)
obj graphTooltip
obj time
obj timepicker
fn withHidden(value=true)
fn withNowDelay(value)
fn withRefreshIntervals(value=["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"])
fn withRefreshIntervalsMixin(value=["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"])
fn withTimeOptions(value=["5m","15m","1h","6h","12h","24h","2d","7d","30d"])
fn withTimeOptionsMixin(value=["5m","15m","1h","6h","12h","24h","2d","7d","30d"])
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
- default value:
Whether a dashboard is editable or not.
fn withFiscalYearStartMonth
withFiscalYearStartMonth(value=0)
PARAMETERS:
- value (
integer
)- default value:
0
- default value:
The month that the fiscal year starts on. 0 = January, 11 = December
fn withLinks
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
- default value:
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
- default value:
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
- default value:
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
- default value:
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"
- default value:
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"
- default value:
fn time.withTo
time.withTo(value="now")
PARAMETERS:
- value (
string
)- default value:
"now"
- default value:
obj timepicker
fn timepicker.withHidden
timepicker.withHidden(value=true)
PARAMETERS:
- value (
boolean
)- default value:
true
- default value:
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"]
- default value:
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"]
- default value:
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"]
- default value:
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"]
- default value:
Selectable options available in the time picker dropdown. Has no effect on provisioned dashboard.