Skip to content

Commit

Permalink
migrate: remaining dashboards.new calls
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Apr 5, 2024
1 parent 5b77723 commit 5b662f4
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 124 deletions.
108 changes: 49 additions & 59 deletions dashboards/jupyterhub.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -551,63 +551,53 @@ local notebookImagesUsed = graphPanel.new(
),
]);

dashboard.new(
'JupyterHub Dashboard',
tags=['jupyterhub'],
uid='hub-dashboard',
editable=true
).addTemplates(
templates
).addPanel(
row.new('Hub usage stats'), {}
).addPanel(
currentActiveUsers, {}
).addPanel(
dailyActiveUsers, {}
).addPanel(
weeklyActiveUsers, {}
).addPanel(
monthlyActiveUsers, {}
).addPanel(
row.new('Container Images'), {},
).addPanel(
notebookImagesUsed, {}
).addPanel(
row.new('User Resource Utilization stats'), {}
).addPanel(
userAgeDistribution, {}
).addPanel(
userCPUDistribution, {},
).addPanel(
userMemoryDistribution, {}
).addPanel(
row.new('Hub Diagnostics'), {}
).addPanel(
serverStartTimes, {}
).addPanel(
serverSpawnFailures, {}
).addPanel(
hubResponseLatency, {}
).addPanel(
hubResponseCodes, {}
).addPanel(
allComponentsCPU, { h: standardDims.h * 1.5 },
).addPanel(
allComponentsMemory, { h: standardDims.h * 1.5 },
).addPanel(
hubDBUsage, {},
).addPanel(
nonRunningPods, {}
).addPanel(
usersPerNode, {}
).addPanel(
sharedVolumeFreeSpace, {}
).addPanel(
row.new('Anomalous user pods'), {},
).addPanel(
oldUserpods, { h: standardDims.h * 1.5 },
).addPanel(
highCPUUserPods, { h: standardDims.h * 1.5 },
).addPanel(
highMemoryUsagePods, { h: standardDims.h * 1.5 },
dashboard.new('JupyterHub Dashboard')
+ dashboard.withTags(['jupyterhub'])
+ dashboard.withUid('hub-dashboard')
+ dashboard.withEditable(true)
// FIXME: addTemplates didn't translate to withTemplates --- + dashboard.withTemplates(templates)
+ dashboard.withPanels(
grafonnet.util.grid.makeGrid(
[
row.new('Hub usage stats')
+ row.withPanels([
currentActiveUsers,
dailyActiveUsers,
weeklyActiveUsers,
monthlyActiveUsers,
]),
row.new('Container Images')
+ row.withPanels([
notebookImagesUsed,
]),
row.new('User Resource Utilization stats')
+ row.withPanels([
userAgeDistribution,
userCPUDistribution,
userMemoryDistribution,
]),
row.new('Hub Diagnostics')
+ row.withPanels([
serverStartTimes,
serverSpawnFailures,
hubResponseLatency,
hubResponseCodes,
allComponentsCPU, // FIXME: previously specified as, is it ok now? { h: standardDims.h * 1.5 },
allComponentsMemory, // FIXME: previously specified as, is it ok now? { h: standardDims.h * 1.5 },
hubDBUsage,
nonRunningPods,
usersPerNode,
sharedVolumeFreeSpace,
]),
row.new('Anomalous user pods')
+ row.withPanels([
oldUserpods, // FIXME: previously specified as, is it ok now? { h: standardDims.h * 1.5 },
highCPUUserPods, // FIXME: previously specified as, is it ok now? { h: standardDims.h * 1.5 },
highMemoryUsagePods, // FIXME: previously specified as, is it ok now? { h: standardDims.h * 1.5 },
]),
],
// FIXME: panelWidth and panelHeight specified like cluster.jsonnet without visual check
panelWidth=12,
panelHeight=8,
)
)
62 changes: 29 additions & 33 deletions dashboards/support.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -152,37 +152,33 @@ local prometheusNetwork = graphPanel.new(
),
]);

dashboard.new(
'NFS and Support Information',
tags=['support', 'kubernetes'],
editable=true
).addTemplates(
templates
).addPanel(
row.new('NFS diagnostics'), {},
).addPanel(
userNodesNFSOps, {},
).addPanel(
userNodesIOWait, {},
).addPanel(
userNodesHighNFSOps, {},
).addPanel(
nfsServerCPU, {},
).addPanel(
nfsServerIOPS, {},
).addPanel(
nfsServerWriteLatency, {},
).addPanel(
nfsServerReadLatency, {},

).addPanel(
row.new('Support system diagnostics'), {},
).addPanel(
prometheusCPU, {},
).addPanel(
prometheusMemory, {},
).addPanel(
prometheusDiskSpace, {},
).addPanel(
prometheusNetwork, {},
dashboard.new('NFS and Support Information')
+ dashboard.withTags(['support', 'kubernetes'])
+ dashboard.withEditable(true)
// FIXME: addTemplates didn't translate to withTemplates --- + dashboard.withTemplates(templates)
+ dashboard.withPanels(
grafonnet.util.grid.makeGrid(
[
row.new('NFS diagnostics')
+ row.withPanels([
userNodesNFSOps,
userNodesIOWait,
userNodesHighNFSOps,
nfsServerCPU,
nfsServerIOPS,
nfsServerWriteLatency,
nfsServerReadLatency,
]),
row.new('Support system diagnostics')
+ row.withPanels([
prometheusCPU,
prometheusMemory,
prometheusDiskSpace,
prometheusNetwork,
]),
],
// FIXME: panelWidth and panelHeight specified like cluster.jsonnet without visual check
panelWidth=12,
panelHeight=8,
)
)
30 changes: 15 additions & 15 deletions dashboards/usage-report.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,19 @@ local memoryUsageDaskWorkerPods = common.barChartOptions + barGauge.new(
// ]);
dashboard.new(
'Usage Report',
) + dashboard.withTags(
['jupyterhub', 'dask']
) + dashboard.withEditable(
true
) + dashboard.withVariables(
variables
) + dashboard.withPanels(
grafonnet.util.grid.makeGrid([
memoryUsageUserPods,
// memoryUsageDaskWorkerPods,
// memoryUsageDaskSchedulerPods,
// memoryUsageGPUPods
], panelWidth=12, panelHeight=8)
dashboard.new('Usage Report')
+ dashboard.withTags(['jupyterhub', 'dask'])
+ dashboard.withEditable(true)
+ dashboard.withVariables(variables)
+ dashboard.withPanels(
grafonnet.util.grid.makeGrid(
[
memoryUsageUserPods,
// memoryUsageDaskWorkerPods,
// memoryUsageDaskSchedulerPods,
// memoryUsageGPUPods
],
panelWidth=12,
panelHeight=8,
)
)
35 changes: 18 additions & 17 deletions dashboards/user.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,22 @@ local cpuRequests = graphPanel.new(
),
);

dashboard.new(
'User Diagnostics Dashboard',
tags=['jupyterhub'],
uid='user-pod-diagnostics-dashboard',
editable=true
).addTemplates(
templates
).addPanel(
memoryUsage, { h: standardDims.h * 1.5, w: standardDims.w * 2 }
).addPanel(
cpuUsage, { h: standardDims.h * 1.5, w: standardDims.w * 2 }
).addPanel(
homedirSharedUsage, { h: standardDims.h * 1.5, w: standardDims.w * 2 }
).addPanel(
memoryRequests, { h: standardDims.h * 1.5, w: standardDims.w * 2 }
).addPanel(
cpuRequests, { h: standardDims.h * 1.5, w: standardDims.w * 2 }
dashboard.new('User Diagnostics Dashboard')
+ dashboards.withTags(['jupyterhub'])
+ dashboards.withUid('user-pod-diagnostics-dashboard')
+ dashboards.withEditable(true)
// FIXME: addTemplates didn't translate to withTemplates --- + dashboard.withTemplates(templates)
+ dashboard.withPanels(
grafonnet.util.grid.makeGrid(
[
memoryUsage, // FIXME: previously specified as, is it ok now? { h: standardDims.h * 1.5, w: standardDims.w * 2 }
cpuUsage, // FIXME: previously specified as, is it ok now? { h: standardDims.h * 1.5, w: standardDims.w * 2 }
homedirSharedUsage, // FIXME: previously specified as, is it ok now? { h: standardDims.h * 1.5, w: standardDims.w * 2 }
memoryRequests, // FIXME: previously specified as, is it ok now? { h: standardDims.h * 1.5, w: standardDims.w * 2 }
cpuRequests, // FIXME: previously specified as, is it ok now? { h: standardDims.h * 1.5, w: standardDims.w * 2 }
],
// FIXME: panelWidth and panelHeight specified like cluster.jsonnet without visual check
panelWidth=12,
panelHeight=8,
)
)

0 comments on commit 5b662f4

Please sign in to comment.