class Dashboard(g.Dashboard): time = attr.ib(default=g.Time("now-30d", "now")) templating = attr.ib( default=g.Templating( list=[ # Make it possible to use $source as a source. g.Template(name="source", type="datasource", query="prometheus") ] ) )
def GenerateDashboard(self): return core.Dashboard(title=self.title, refresh='1s', time=core.Time('now-5m', 'now'), timePicker=core.TimePicker(refreshIntervals=[ '1s', '3s', '10s', '30s', ], timeOptions=[ '5m', '15m', '1h', '6h', '12h', '24h', '2d', ]), panels=self.panels).auto_panel_ids()
class Dashboard(g.Dashboard): time = attr.ib(default=g.Time("now-30d", "now")) # Make it possible to use $source as a source. templating = attr.ib(default=g.Templating(list=[SOURCE_TEMPLATE]))
legendFormat="OutSegs {{instance}}", ), g.Target( expr= "sum(rate(node_netstat_Tcp_RetransSegs[1m])) by (instance)", legendFormat="RetransSegs {{instance}}", ), ], yAxes=g.single_y_axis(format=g.SHORT_FORMAT, logBase=10), ), ] # The final dashboard must be named 'dashboard' so that grafanalib will find it. dashboard = g.Dashboard( title="Master dashboard", time=g.Time("now-30d", "now"), templating=g.Templating(list=[ # Make it possible to use $source as a source. g.Template(name="source", type="datasource", query="prometheus") ]), rows=[ g.Row( title="Clusterloader", height=DEFAULT_PANEL_HEIGHT, panels=CLUSTERLOADER_PANELS, ), g.Row( title="Overall cluster health", height=DEFAULT_PANEL_HEIGHT, panels=HEALTH_PANELS, ),