Skip to content

Commit

Permalink
Merge pull request #3 from chaitanyaenr/cluster_operators
Browse files Browse the repository at this point in the history
Add cluster operators panel and more metrics
  • Loading branch information
rsevilla87 authored Sep 30, 2020
2 parents 40a4abd + 7769b9e commit f7fe1e5
Showing 1 changed file with 91 additions and 2 deletions.
93 changes: 91 additions & 2 deletions templates/ocp-performance.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ local current_namespace_count = grafana.statPanel.new(

local current_pod_count = grafana.statPanel.new(
title='Current Pod Count',
datasource='$datasource',
reducerFunction='last',
datasource='$datasource',
).addTarget(
prometheus.target(
'sum(kube_pod_status_phase{namespace=~"$namespace"}) by (phase) > 0',
Expand Down Expand Up @@ -528,6 +528,42 @@ local cmCount = grafana.graphPanel.new(
)
);

local servicesCount = grafana.graphPanel.new(
title='Services count',
format='none',
datasource='$datasource',
legend_values=true,
legend_alignAsTable=true,
legend_current=true,
legend_max=true,
legend_sort='max',
legend_sortDesc=true,
legend_hideZero=true,
).addTarget(
prometheus.target(
'count(kube_service_info{})',
legendFormat='Services',
)
);

local routesCount = grafana.graphPanel.new(
title='Routes count',
format='none',
datasource='$datasource',
legend_values=true,
legend_alignAsTable=true,
legend_current=true,
legend_max=true,
legend_sort='max',
legend_sortDesc=true,
legend_hideZero=true,
).addTarget(
prometheus.target(
'count(openshift_route_info{})',
legendFormat='Routes',
)
);

local alerts = grafana.graphPanel.new(
title='Alerts',
format='none',
Expand Down Expand Up @@ -587,6 +623,51 @@ local goroutines_count = grafana.graphPanel.new(
)
);

// Cluster operators

local clusterOperatorsOverview = grafana.statPanel.new(
datasource='$datasource',
title='Cluster operators overview',
).addTarget(
prometheus.target(
'sum by (condition)(cluster_operator_conditions{condition!=""})',
legendFormat='{{ condition }}',
)
);

local clusterOperatorsInformation = grafana.graphPanel.new(
datasource='$datasource',
title='Cluster operators information',
legend_values=true,
legend_alignAsTable=true,
legend_current=true,
legend_max=true,
legend_sort='max',
legend_sortDesc=true,
).addTarget(
prometheus.target(
'cluster_operator_conditions{name!="",reason!=""}',
legendFormat='{{name}} - {{reason}}',
)
);

local clusterOperatorsDegraded = grafana.graphPanel.new(
datasource='$datasource',
title='Cluster operators degraded',
legend_values=true,
legend_alignAsTable=true,
legend_current=true,
legend_max=true,
legend_sort='max',
legend_sortDesc=true,
).addTarget(
prometheus.target(
'cluster_operator_conditions{condition="Degraded",name!="",reason!=""}',
legendFormat='{{name}} - {{reason}}',
)
);


// Dashboard

grafana.dashboard.new(
Expand Down Expand Up @@ -735,7 +816,6 @@ grafana.dashboard.new(
), { gridPos: { x: 0, y: 2, w: 24, h: 1 } }
)


.addPanel(grafana.row.new(title='Cluster Details', collapse=true).addPanels(
[
current_node_count { gridPos: { x: 0, y: 4, w: 8, h: 3 } },
Expand All @@ -747,13 +827,22 @@ grafana.dashboard.new(
secretCount { gridPos: { x: 0, y: 20, w: 8, h: 8 } },
deployCount { gridPos: { x: 8, y: 20, w: 8, h: 8 } },
cmCount { gridPos: { x: 16, y: 20, w: 8, h: 8 } },
servicesCount { gridPos: { x: 0, y: 20, w: 8, h: 8 } },
routesCount { gridPos: { x: 8, y: 20, w: 8, h: 8 } },
alerts { gridPos: { x: 0, y: 28, w: 24, h: 8 } },
top10ContMem { gridPos: { x: 0, y: 36, w: 12, h: 8 } },
top10ContCPU { gridPos: { x: 12, y: 36, w: 12, h: 8 } },
goroutines_count { gridPos: { x: 0, y: 44, w: 24, h: 8 } },
]
), { gridPos: { x: 0, y: 3, w: 24, h: 1 } })

.addPanel(grafana.row.new(title='Cluster Operators Details', collapse=true).addPanels(
[
clusterOperatorsOverview { gridPos: { x: 0, y: 4, w: 24, h: 3 } },
clusterOperatorsInformation { gridPos: { x: 0, y: 4, w: 8, h: 8 } },
clusterOperatorsDegraded { gridPos: { x: 8, y: 4, w: 8, h: 8 } },
],
), { gridPos: { x: 0, y: 4, w: 24, h: 1 } })

.addPanel(grafana.row.new(title='Master: $_master_node', collapse=true, repeat='_master_node').addPanels(
[
Expand Down

0 comments on commit f7fe1e5

Please sign in to comment.