Skip to content

Commit

Permalink
feat(dashboard): add summary don panels
Browse files Browse the repository at this point in the history
  • Loading branch information
Atrax1 committed Mar 27, 2024
1 parent 8df2da0 commit f395850
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
41 changes: 41 additions & 0 deletions dashboard-lib/atlas-don/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,46 @@ func vars(p Props) []dashboard.Option {
}
}

func summary(p Props) []dashboard.Option {
return []dashboard.Option{
dashboard.Row("Summary",
row.Collapse(),
row.WithStat(
"Telemetry Down",
stat.DataSource(p.PrometheusDataSource),
stat.Text(stat.TextValueAndName),
stat.Description("Which jobs are not receiving any telemetry?"),
stat.Orientation(stat.OrientationHorizontal),
stat.TitleFontSize(12),
stat.ValueFontSize(12),
stat.Span(12),
stat.WithPrometheusTarget(
`bool:`+p.OcrVersion+`_telemetry_down{`+p.PlatformOpts.LabelQuery+`} == 1`,
prometheus.Legend("{{job}} | {{report_type}}"),
),
),
row.WithStat(
"Oracles Down",
stat.DataSource(p.PrometheusDataSource),
stat.Text(stat.TextName),
stat.Description("Which NOPs are not providing any telemetry?"),
stat.Orientation(stat.OrientationHorizontal),
stat.TitleFontSize(12),
stat.ValueFontSize(12),
stat.Span(12),
stat.ValueType(stat.Last),
stat.WithPrometheusTarget(
`bool:`+p.OcrVersion+`_oracle_telemetry_down_except_telemetry_down{job=~"${job}", oracle!="csa_unknown"} == 1`,
prometheus.Legend("{{oracle}} | {{report_type}}"),
),
stat.AbsoluteThresholds([]stat.ThresholdStep{
{Color: "#FF0000", Value: float64Ptr(1.0)},
}),
),
),
}
}

func ocrContractConfigOracle(p Props) []dashboard.Option {
return []dashboard.Option{
dashboard.Row("OCR Contract Oracle",
Expand Down Expand Up @@ -381,6 +421,7 @@ func roundEpochProgression(p Props) []dashboard.Option {

func New(p Props) []dashboard.Option {
opts := vars(p)
opts = append(opts, summary(p)...)
opts = append(opts, ocrContractConfigOracle(p)...)
opts = append(opts, ocrContractConfigNodes(p)...)
opts = append(opts, ocrContractConfigDelta(p)...)
Expand Down
5 changes: 5 additions & 0 deletions dashboard-lib/atlas-don/utils.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package atlas_don

func float64Ptr(input float64) *float64 {
return &input
}
8 changes: 8 additions & 0 deletions dashboard-lib/k8s-pods/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ func vars(p Props) []dashboard.Option {
query.Request("label_values(up{namespace=\"$namespace\"}, job)"),
query.Sort(query.NumericalAsc),
),
dashboard.VariableAsQuery(
"service",
query.DataSource(p.PrometheusDataSource),
query.Multiple(),
query.IncludeAll(),
query.Request("label_values(up{namespace=\"$namespace\"}, service)"),
query.Sort(query.NumericalAsc),
),
}
}

Expand Down

0 comments on commit f395850

Please sign in to comment.