From b57fd932543d1d17384c5da03c4e81b59ccde47f Mon Sep 17 00:00:00 2001 From: BhoomikaGuptaa Date: Sat, 13 Jun 2026 15:51:12 -0700 Subject: [PATCH] Add CICD Grafana dashboard --- .../provisioning/dashboards/cicd.dashboard.py | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 grafana/provisioning/dashboards/cicd.dashboard.py diff --git a/grafana/provisioning/dashboards/cicd.dashboard.py b/grafana/provisioning/dashboards/cicd.dashboard.py new file mode 100644 index 0000000..dcc4ed5 --- /dev/null +++ b/grafana/provisioning/dashboards/cicd.dashboard.py @@ -0,0 +1,76 @@ +from grafanalib.formatunits import NUMBER_FORMAT, SECONDS + +from wrapper import SceGrafanalibWrapper, ExpressionAndLegendPair, PanelType + +wrapper = SceGrafanalibWrapper(title="CICD") + +wrapper.AddPanel( + title="CICD Deployments", + queries=[ + ExpressionAndLegendPair( + 'cicd_deployments_total', + "{{repo}} {{branch}}", + ) + ], + dydt=True, + unit=NUMBER_FORMAT, +) + +wrapper.AddPanel( + title="CICD Deployment Failures", + queries=[ + ExpressionAndLegendPair( + 'cicd_deployment_failures_total', + "{{repo}} {{branch}}", + ) + ], + dydt=True, + unit=NUMBER_FORMAT, +) + +wrapper.AddPanel( + title="CICD Restarts", + queries=[ + ExpressionAndLegendPair( + 'cicd_restarts_total', + "{{host}}", + ) + ], + dydt=True, + unit=NUMBER_FORMAT, +) + +wrapper.AddPanel( + title="CICD Deployment Duration", + queries=[ + ExpressionAndLegendPair( + 'cicd_deployment_duration_seconds', + "{{repo}} {{branch}}", + ) + ], + unit=SECONDS, +) + +wrapper.AddPanel( + title="CICD Server Uptime", + queries=[ + ExpressionAndLegendPair( + 'time() - process_start_time_seconds{job="sce-cicd"}', + ) + ], + unit=SECONDS, +) + +wrapper.AddPanel( + title="CICD Server Up", + queries=[ + ExpressionAndLegendPair( + 'up{job="sce-cicd"}', + "{{instance}}", + ) + ], + panel_type_enum=PanelType.STAT, + unit=NUMBER_FORMAT, +) + +dashboard = wrapper.Render()