Skip to content

Commit

Permalink
Run pre-commit and ignore vendored files
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Oct 7, 2023
1 parent e957027 commit f5aba6a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ repos:
rev: v0.20.0
hooks:
- id: jsonnet-format
# jsonnet-lint hook doesn't work
# - id: jsonnet-lint
exclude: ^vendor/.*
48 changes: 24 additions & 24 deletions dashboards/cluster.jsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Deploys a dashboard showing cluster-wide information
local grafonnet = import "github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet";
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet';
local dashboard = grafonnet.dashboard;
local ts = grafonnet.panel.timeSeries;
local prometheus = grafonnet.query.prometheus;
Expand All @@ -19,30 +19,30 @@ local variables = [
local userNodes = ts.new(
'Node Count'
) + ts.panelOptions.withDescription(
"Number of nodes in each nodepool in this cluster"
'Number of nodes in each nodepool in this cluster'
) + ts.standardOptions.withMin(
0
) + ts.queryOptions.withTargets([
prometheus.new(
'$PROMETHEUS_DS',
|||
# sum up all nodes by nodepool
sum(
# kube_pod_labels comes from
# https://github.com/kubernetes/kube-state-metrics, and there is a particular
# label (kubernetes_node) that lists the node on which the kube-state-metrics pod
# s running! So that's totally irrelevant to these queries, but when a nodepool
# is rotated it caused there to exist two metrics with the same node value (which
# we care about) but different kubernetes_node values (because kube-state-metrics
# was running in a different node, even though we don't care about that). This
# group really just drops all labels except the two we care about to
# avoid messing things up.
group(
kube_node_labels
) by (node, label_cloud_google_com_gke_nodepool)
) by (label_cloud_google_com_gke_nodepool)
|||
) + prometheus.withLegendFormat('{{label_cloud_google_com_gke_nodepool}}')
prometheus.new(
'$PROMETHEUS_DS',
|||
# sum up all nodes by nodepool
sum(
# kube_pod_labels comes from
# https://github.com/kubernetes/kube-state-metrics, and there is a particular
# label (kubernetes_node) that lists the node on which the kube-state-metrics pod
# s running! So that's totally irrelevant to these queries, but when a nodepool
# is rotated it caused there to exist two metrics with the same node value (which
# we care about) but different kubernetes_node values (because kube-state-metrics
# was running in a different node, even though we don't care about that). This
# group really just drops all labels except the two we care about to
# avoid messing things up.
group(
kube_node_labels
) by (node, label_cloud_google_com_gke_nodepool)
) by (label_cloud_google_com_gke_nodepool)
|||
) + prometheus.withLegendFormat('{{label_cloud_google_com_gke_nodepool}}'),
]);

local userPods = ts.new(
Expand Down Expand Up @@ -357,9 +357,9 @@ dashboard.new(
userPods,
// clusterMemoryCommitment,
// clusterCPUCommitment,
userNodes
userNodes,
])
]),
// nonRunningPods,
// row.new('Node Stats'),
// nodeCPUUtil,
Expand Down
2 changes: 1 addition & 1 deletion dashboards/jupyterhub.libsonnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local grafonnet = import "github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet";
local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-v10.0.0/main.libsonnet';
local graphPanel = grafonnet.graphPanel;
local prometheus = grafonnet.prometheus;

Expand Down

0 comments on commit f5aba6a

Please sign in to comment.