From 0cfb8f970324c34e0959cd4f5ef16ccc9d7d156a Mon Sep 17 00:00:00 2001 From: Clement Erena Date: Thu, 11 Apr 2024 13:52:21 +0200 Subject: [PATCH] feat(dashboard): cleanup --- charts/chainlink-cluster/README.md | 5 +- .../chainlink-cluster/dashboard/cmd/deploy.go | 30 +- dashboard-lib/atlas-don/component.go | 415 ++++++++++-------- dashboard-lib/atlas-don/platform.go | 20 +- dashboard-lib/k8s-pods/component.go | 12 +- 5 files changed, 272 insertions(+), 210 deletions(-) diff --git a/charts/chainlink-cluster/README.md b/charts/chainlink-cluster/README.md index 0fbbd5d16df..a0a4b8a78cc 100644 --- a/charts/chainlink-cluster/README.md +++ b/charts/chainlink-cluster/README.md @@ -151,6 +151,9 @@ We are using [Grabana](https://github.com/K-Phoen/grabana) lib to create dashboa You can also select dashboard platform in `INFRA_PLATFORM` either `kubernetes` or `docker` +You can select the dashboard panels with `PANELS_INCLUDED` which is a list of panel names separated by comma +If you don't specify it will include core panels by default + ``` export LOKI_TENANT_ID=promtail export LOKI_URL=... @@ -159,7 +162,7 @@ export GRAFANA_TOKEN=... export PROMETHEUS_DATA_SOURCE_NAME=Thanos export LOKI_DATA_SOURCE_NAME=Loki export INFRA_PLATFORM=kubernetes -export GRAFANA_FOLDER=CRIB +export GRAFANA_FOLDER=DashboardCoreDebug export DASHBOARD_NAME=CL-Cluster devspace run dashboard_deploy diff --git a/charts/chainlink-cluster/dashboard/cmd/deploy.go b/charts/chainlink-cluster/dashboard/cmd/deploy.go index 7881aecd162..5c8e37b7ad4 100644 --- a/charts/chainlink-cluster/dashboard/cmd/deploy.go +++ b/charts/chainlink-cluster/dashboard/cmd/deploy.go @@ -18,23 +18,17 @@ func main() { dashboard.Tags([]string{"generated"}), }, ) - db.Add( - core_don.New( - core_don.Props{ - PrometheusDataSource: cfg.DataSources.Prometheus, - PlatformOpts: core_don.PlatformPanelOpts(cfg.Platform), - }, - ), - ) - if cfg.Platform == "kubernetes" { + if len(cfg.PanelsIncluded) == 1 || cfg.PanelsIncluded["core"] { db.Add( - k8spods.New( - k8spods.Props{ + core_don.New( + core_don.Props{ PrometheusDataSource: cfg.DataSources.Prometheus, - LokiDataSource: cfg.DataSources.Loki, + PlatformOpts: core_don.PlatformPanelOpts(cfg.Platform), }, ), ) + // TODO: refactor as a component later + addWASPRows(db, cfg) } if cfg.PanelsIncluded["ocr"] || cfg.PanelsIncluded["ocr2"] || cfg.PanelsIncluded["ocr3"] { for key := range cfg.PanelsIncluded { @@ -51,8 +45,16 @@ func main() { } } } - // TODO: refactor as a component later - addWASPRows(db, cfg) + if cfg.Platform == "kubernetes" { + db.Add( + k8spods.New( + k8spods.Props{ + PrometheusDataSource: cfg.DataSources.Prometheus, + LokiDataSource: cfg.DataSources.Loki, + }, + ), + ) + } if err := db.Deploy(); err != nil { lib.L.Fatal().Err(err).Msg("failed to deploy the dashboard") } diff --git a/dashboard-lib/atlas-don/component.go b/dashboard-lib/atlas-don/component.go index 0bdec7c5258..7b0e920fd03 100644 --- a/dashboard-lib/atlas-don/component.go +++ b/dashboard-lib/atlas-don/component.go @@ -3,7 +3,6 @@ package atlas_don import ( "fmt" "github.com/K-Phoen/grabana/dashboard" - "github.com/K-Phoen/grabana/gauge" "github.com/K-Phoen/grabana/row" "github.com/K-Phoen/grabana/stat" "github.com/K-Phoen/grabana/target/prometheus" @@ -25,7 +24,7 @@ func vars(p Props) []dashboard.Option { query.DataSource(p.PrometheusDataSource), query.Multiple(), query.IncludeAll(), - query.Request(fmt.Sprintf("label_values(%s)", "contract")), + query.Request(fmt.Sprintf(`label_values(`+p.OcrVersion+`_contract_config_f{job="$job"}, %s)`, "contract")), query.Sort(query.NumericalAsc), ), dashboard.VariableAsQuery( @@ -33,7 +32,7 @@ func vars(p Props) []dashboard.Option { query.DataSource(p.PrometheusDataSource), query.Multiple(), query.IncludeAll(), - query.Request(fmt.Sprintf("label_values(%s)", "feed_id_name")), + query.Request(fmt.Sprintf(`label_values(`+p.OcrVersion+`_contract_config_f{job="$job", contract="$contract"}, %s)`, "feed_id_name")), query.Sort(query.NumericalAsc), ), } @@ -42,20 +41,23 @@ 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.Text(stat.TextName), stat.Description("Which jobs are not receiving any telemetry?"), stat.Orientation(stat.OrientationHorizontal), stat.TitleFontSize(12), stat.ValueFontSize(12), - stat.Span(12), + stat.Span(4), stat.WithPrometheusTarget( `bool:`+p.OcrVersion+`_telemetry_down{`+p.PlatformOpts.LabelQuery+`} == 1`, prometheus.Legend("{{job}} | {{report_type}}"), ), + stat.AbsoluteThresholds([]stat.ThresholdStep{ + {Color: "#008000", Value: float64Ptr(0.0)}, + {Color: "#FF0000", Value: float64Ptr(1.0)}, + }), ), row.WithStat( "Oracles Down", @@ -65,13 +67,90 @@ func summary(p Props) []dashboard.Option { stat.Orientation(stat.OrientationHorizontal), stat.TitleFontSize(12), stat.ValueFontSize(12), - stat.Span(12), + stat.Span(4), 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: "#008000", Value: float64Ptr(0.0)}, + {Color: "#FF0000", Value: float64Ptr(1.0)}, + }), + ), + row.WithStat( + "Feeds reporting failure", + stat.DataSource(p.PrometheusDataSource), + stat.Text(stat.TextName), + stat.Description("Which feeds are failing to report?"), + stat.Orientation(stat.OrientationHorizontal), + stat.TitleFontSize(12), + stat.ValueFontSize(12), + stat.Span(4), + stat.ValueType(stat.Last), + stat.WithPrometheusTarget( + `bool:`+p.OcrVersion+`_feed_reporting_failure_except_feed_telemetry_down{job=~"${job}", oracle!="csa_unknown"} == 1`, + prometheus.Legend("{{feed_id_name}} on {{job}}"), + ), + stat.AbsoluteThresholds([]stat.ThresholdStep{ + {Color: "#008000", Value: float64Ptr(0.0)}, + {Color: "#FF0000", Value: float64Ptr(1.0)}, + }), + ), + row.WithStat( + "Feed telemetry Down", + stat.DataSource(p.PrometheusDataSource), + stat.Text(stat.TextName), + stat.Description("Which feeds are not receiving any telemetry?"), + stat.Orientation(stat.OrientationHorizontal), + stat.TitleFontSize(12), + stat.ValueFontSize(12), + stat.Span(4), + stat.ValueType(stat.Last), + stat.WithPrometheusTarget( + `bool:`+p.OcrVersion+`_feed_telemetry_down_except_telemetry_down{job=~"${job}"} == 1`, + prometheus.Legend("{{feed_id_name}} on {{job}}"), + ), + stat.AbsoluteThresholds([]stat.ThresholdStep{ + {Color: "#008000", Value: float64Ptr(0.0)}, + {Color: "#FF0000", Value: float64Ptr(1.0)}, + }), + ), + row.WithStat( + "Oracles no observations", + stat.DataSource(p.PrometheusDataSource), + stat.Text(stat.TextName), + stat.Description("Which NOPs are not providing observations?"), + stat.Orientation(stat.OrientationHorizontal), + stat.TitleFontSize(12), + stat.ValueFontSize(12), + stat.Span(4), + stat.ValueType(stat.Last), + stat.WithPrometheusTarget( + `bool:`+p.OcrVersion+`_oracle_blind_except_telemetry_down{job=~"${job}"} == 1`, + prometheus.Legend("{{oracle}} | {{report_type}}"), + ), + stat.AbsoluteThresholds([]stat.ThresholdStep{ + {Color: "#008000", Value: float64Ptr(0.0)}, + {Color: "#FF0000", Value: float64Ptr(1.0)}, + }), + ), + row.WithStat( + "Oracles not contributing observations to feeds", + stat.DataSource(p.PrometheusDataSource), + stat.Text(stat.TextName), + stat.Description("Which oracles are failing to make observations on feeds they should be participating in?"), + stat.Orientation(stat.OrientationHorizontal), + stat.TitleFontSize(12), + stat.ValueFontSize(12), + stat.Span(4), + stat.ValueType(stat.Last), + stat.WithPrometheusTarget( + `bool:`+p.OcrVersion+`_oracle_feed_no_observations_except_oracle_blind_except_feed_reporting_failure_except_feed_telemetry_down{job=~"${job}"} == 1`, + prometheus.Legend("{{oracle}} | {{report_type}}"), + ), + stat.AbsoluteThresholds([]stat.ThresholdStep{ + {Color: "#008000", Value: float64Ptr(0.0)}, {Color: "#FF0000", Value: float64Ptr(1.0)}, }), ), @@ -94,95 +173,150 @@ func ocrContractConfigOracle(p Props) []dashboard.Option { stat.Span(12), stat.WithPrometheusTarget( ``+p.OcrVersion+`_contract_oracle_active{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }} - {{oracle}}"), + prometheus.Legend("{{ contract }} - {{oracle}}"), ), + stat.AbsoluteThresholds([]stat.ThresholdStep{ + {Color: "#FF0000", Value: float64Ptr(0.0)}, + {Color: "#008000", Value: float64Ptr(1.0)}, + }), ), - row.WithGauge( - "OCR Contract Oracle Active", - gauge.Span(12), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.Description("set to one as long as an oracle is on a feed"), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_oracle_active{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }} - {{oracle}}"), + ), + } +} + +func ocrContractConfigNodes(p Props) []dashboard.Option { + return []dashboard.Option{ + dashboard.Row("DON Nodes", + row.Collapse(), + row.WithTimeSeries( + "Number of observations from MessageObserve sent", + timeseries.Span(12), + timeseries.DataSource(p.PrometheusDataSource), + timeseries.Legend(timeseries.ToTheRight), + timeseries.Axis( + axis.Min(0), + ), + timeseries.WithPrometheusTarget( + ``+p.OcrVersion+`_telemetry_message_observe_total_nop_count{contract=~"${contract}", feed_id_name=~"${feed_id_name}", job=~"${job}"}`, + prometheus.Legend("{{feed_id_name}}"), + ), + timeseries.WithPrometheusTarget( + `avg(2 * `+p.OcrVersion+`_contract_config_f{`+p.PlatformOpts.LabelQuery+`} + 4)`, + prometheus.Legend("Max nodes"), + ), + timeseries.WithPrometheusTarget( + `avg(2 * `+p.OcrVersion+`_contract_config_f{`+p.PlatformOpts.LabelQuery+`} + 1)`, + prometheus.Legend("Min nodes"), ), ), ), } } -func ocrContractConfigNodes(p Props) []dashboard.Option { +func priceReporting(p Props) []dashboard.Option { return []dashboard.Option{ - dashboard.Row("OCR Contract Config Nodes", + dashboard.Row("Price Reporting", row.Collapse(), - row.WithStat( - "Node Count", - stat.DataSource(p.PrometheusDataSource), - stat.Text(stat.TextValueAndName), - stat.Orientation(stat.OrientationHorizontal), - stat.TitleFontSize(12), - stat.ValueFontSize(20), - stat.Span(6), - stat.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_n{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + row.WithTimeSeries( + "Ask observation in MessageObserve sent", + timeseries.Span(12), + timeseries.Legend(timeseries.ToTheRight), + timeseries.DataSource(p.PrometheusDataSource), + timeseries.WithPrometheusTarget( + ``+p.OcrVersion+`_telemetry_observation_ask{contract=~"${contract}", feed_id_name=~"${feed_id_name}", job=~"${job}"}`, + prometheus.Legend("{{oracle}}"), ), ), - row.WithGauge( - "Node Count", - gauge.Span(6), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_n{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + row.WithTimeSeries( + "Price observation in MessageObserve sent", + timeseries.Span(12), + timeseries.Legend(timeseries.ToTheRight), + timeseries.DataSource(p.PrometheusDataSource), + timeseries.WithPrometheusTarget( + ``+p.OcrVersion+`_telemetry_observation{contract=~"${contract}", feed_id_name=~"${feed_id_name}", job=~"${job}"}`, + prometheus.Legend("{{oracle}}"), ), ), - row.WithStat( - "Max Faulty Node Count", - stat.DataSource(p.PrometheusDataSource), - stat.Text(stat.TextValueAndName), - stat.Orientation(stat.OrientationHorizontal), - stat.TitleFontSize(12), - stat.ValueFontSize(20), - stat.Span(6), - stat.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_f{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + row.WithTimeSeries( + "Bid observation in MessageObserve sent", + timeseries.Span(12), + timeseries.Legend(timeseries.ToTheRight), + timeseries.DataSource(p.PrometheusDataSource), + timeseries.WithPrometheusTarget( + ``+p.OcrVersion+`_telemetry_observation_bid{contract=~"${contract}", feed_id_name=~"${feed_id_name}", job=~"${job}"}`, + prometheus.Legend("{{oracle}}"), ), ), - row.WithGauge( - "Max Faulty Node Count", - gauge.Span(6), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_f{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + row.WithTimeSeries( + "Ask MessagePropose observations", + timeseries.Span(12), + timeseries.Legend(timeseries.ToTheRight), + timeseries.DataSource(p.PrometheusDataSource), + timeseries.WithPrometheusTarget( + ``+p.OcrVersion+`_telemetry_message_propose_observation_ask{contract=~"${contract}", feed_id_name=~"${feed_id_name}", job=~"${job}"}`, + prometheus.Legend("{{oracle}}"), ), ), - row.WithStat( - "Max Round Node Count", - stat.DataSource(p.PrometheusDataSource), - stat.Text(stat.TextValueAndName), - stat.Orientation(stat.OrientationHorizontal), - stat.TitleFontSize(12), - stat.ValueFontSize(20), - stat.Span(6), - stat.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_r_max{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + row.WithTimeSeries( + "Price MessagePropose observations", + timeseries.Span(12), + timeseries.Legend(timeseries.ToTheRight), + timeseries.DataSource(p.PrometheusDataSource), + timeseries.WithPrometheusTarget( + ``+p.OcrVersion+`_telemetry_message_propose_observation{contract=~"${contract}", feed_id_name=~"${feed_id_name}", job=~"${job}"}`, + prometheus.Legend("{{oracle}}"), + ), + ), + row.WithTimeSeries( + "Bid MessagePropose observations", + timeseries.Span(12), + timeseries.Legend(timeseries.ToTheRight), + timeseries.DataSource(p.PrometheusDataSource), + timeseries.WithPrometheusTarget( + ``+p.OcrVersion+`_telemetry_message_propose_observation_bid{contract=~"${contract}", feed_id_name=~"${feed_id_name}", job=~"${job}"}`, + prometheus.Legend("{{oracle}}"), + ), + ), + row.WithTimeSeries( + "Total number of observations included in MessagePropose", + timeseries.Span(12), + timeseries.Description("How often is a node's observation included in the report?"), + timeseries.Legend(timeseries.ToTheRight), + timeseries.Axis( + axis.Min(0), + ), + timeseries.DataSource(p.PrometheusDataSource), + timeseries.WithPrometheusTarget( + `rate(`+p.OcrVersion+`_telemetry_message_propose_observation_total{contract=~"${contract}", feed_id_name=~"${feed_id_name}", job=~"${job}"}[5m])`, + prometheus.Legend("{{oracle}}"), + ), + ), + row.WithTimeSeries( + "Total MessageObserve sent", + timeseries.Span(12), + timeseries.Description("From an individual node's perspective, how often are they sending an observation?"), + timeseries.Legend(timeseries.ToTheRight), + timeseries.Axis( + axis.Min(0), + ), + timeseries.DataSource(p.PrometheusDataSource), + timeseries.WithPrometheusTarget( + `rate(`+p.OcrVersion+`_telemetry_message_observe_total{contract=~"${contract}", feed_id_name=~"${feed_id_name}", job=~"${job}"}[5m])`, + prometheus.Legend("{{oracle}}"), ), ), - row.WithGauge( - "Max Round Node Count", - gauge.Span(6), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_r_max{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + row.WithTimeSeries( + "P2P messages received", + timeseries.Span(12), + timeseries.Height("600px"), + timeseries.Description("From an individual node's perspective, how many messages are they receiving from other nodes? Uses ocr_telemetry_p2p_received_total"), + timeseries.Axis( + axis.Min(0), + ), + timeseries.DataSource(p.PrometheusDataSource), + timeseries.WithPrometheusTarget( + `sum by (sender, receiver) (increase(`+p.OcrVersion+`_telemetry_p2p_received_total{job=~"${job}"}"}[5m]))`, + prometheus.Legend("{{sender}} > {{receiver}}"), ), ), ), @@ -199,21 +333,12 @@ func ocrContractConfigDelta(p Props) []dashboard.Option { stat.Text(stat.TextValueAndName), stat.Orientation(stat.OrientationHorizontal), stat.TitleFontSize(12), - stat.ValueFontSize(20), - stat.Span(6), + stat.ValueFontSize(28), + stat.Span(4), + stat.SparkLine(), stat.WithPrometheusTarget( ``+p.OcrVersion+`_contract_config_alpha{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), - ), - ), - row.WithGauge( - "relativeDeviationThreshold", - gauge.Span(6), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_alpha{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + prometheus.Legend("{{ contract }}"), ), ), row.WithStat( @@ -222,21 +347,12 @@ func ocrContractConfigDelta(p Props) []dashboard.Option { stat.Text(stat.TextValueAndName), stat.Orientation(stat.OrientationHorizontal), stat.TitleFontSize(12), - stat.ValueFontSize(20), - stat.Span(6), + stat.ValueFontSize(28), + stat.Span(4), + stat.SparkLine(), stat.WithPrometheusTarget( ``+p.OcrVersion+`_contract_config_delta_c_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), - ), - ), - row.WithGauge( - "maxContractValueAgeSeconds", - gauge.Span(6), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_delta_c_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + prometheus.Legend("{{ contract }}"), ), ), row.WithStat( @@ -245,21 +361,12 @@ func ocrContractConfigDelta(p Props) []dashboard.Option { stat.Text(stat.TextValueAndName), stat.Orientation(stat.OrientationHorizontal), stat.TitleFontSize(12), - stat.ValueFontSize(20), - stat.Span(6), + stat.ValueFontSize(28), + stat.Span(4), + stat.SparkLine(), stat.WithPrometheusTarget( ``+p.OcrVersion+`_contract_config_delta_grace_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), - ), - ), - row.WithGauge( - "observationGracePeriodSeconds", - gauge.Span(6), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_delta_grace_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + prometheus.Legend("{{ contract }}"), ), ), row.WithStat( @@ -268,21 +375,12 @@ func ocrContractConfigDelta(p Props) []dashboard.Option { stat.Text(stat.TextValueAndName), stat.Orientation(stat.OrientationHorizontal), stat.TitleFontSize(12), - stat.ValueFontSize(20), - stat.Span(6), + stat.ValueFontSize(28), + stat.Span(4), + stat.SparkLine(), stat.WithPrometheusTarget( ``+p.OcrVersion+`_contract_config_delta_progress_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), - ), - ), - row.WithGauge( - "badEpochTimeoutSeconds", - gauge.Span(6), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_delta_progress_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + prometheus.Legend("{{ contract }}"), ), ), row.WithStat( @@ -291,21 +389,12 @@ func ocrContractConfigDelta(p Props) []dashboard.Option { stat.Text(stat.TextValueAndName), stat.Orientation(stat.OrientationHorizontal), stat.TitleFontSize(12), - stat.ValueFontSize(20), - stat.Span(6), + stat.ValueFontSize(28), + stat.Span(4), + stat.SparkLine(), stat.WithPrometheusTarget( ``+p.OcrVersion+`_contract_config_delta_resend_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), - ), - ), - row.WithGauge( - "resendIntervalSeconds", - gauge.Span(6), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_delta_resend_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + prometheus.Legend("{{ contract }}"), ), ), row.WithStat( @@ -314,21 +403,12 @@ func ocrContractConfigDelta(p Props) []dashboard.Option { stat.Text(stat.TextValueAndName), stat.Orientation(stat.OrientationHorizontal), stat.TitleFontSize(12), - stat.ValueFontSize(20), - stat.Span(6), + stat.ValueFontSize(28), + stat.Span(4), + stat.SparkLine(), stat.WithPrometheusTarget( ``+p.OcrVersion+`_contract_config_delta_round_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), - ), - ), - row.WithGauge( - "roundIntervalSeconds", - gauge.Span(6), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_delta_round_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + prometheus.Legend("{{ contract }}"), ), ), row.WithStat( @@ -337,21 +417,12 @@ func ocrContractConfigDelta(p Props) []dashboard.Option { stat.Text(stat.TextValueAndName), stat.Orientation(stat.OrientationHorizontal), stat.TitleFontSize(12), - stat.ValueFontSize(20), - stat.Span(6), + stat.ValueFontSize(28), + stat.Span(4), + stat.SparkLine(), stat.WithPrometheusTarget( ``+p.OcrVersion+`_contract_config_delta_stage_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), - ), - ), - row.WithGauge( - "transmissionStageTimeoutSeconds", - gauge.Span(6), - gauge.Orientation(gauge.OrientationVertical), - gauge.DataSource(p.PrometheusDataSource), - gauge.WithPrometheusTarget( - ``+p.OcrVersion+`_contract_config_delta_stage_seconds{`+p.PlatformOpts.LabelQuery+`}`, - prometheus.Legend("{{"+p.PlatformOpts.LegendString+"}} - {{ contract }}"), + prometheus.Legend("{{ contract }}"), ), ), ), @@ -371,7 +442,7 @@ func roundEpochProgression(p Props) []dashboard.Option { axis.Unit("short"), ), timeseries.WithPrometheusTarget( - ``+p.OcrVersion+`_telemetry_feed_agreed_epoch{`+p.PlatformOpts.LabelQuery+`feed_id_name=~"${feed_id_name}"}`, + ``+p.OcrVersion+`_telemetry_feed_agreed_epoch{feed_id_name=~"${feed_id_name}"}`, prometheus.Legend("{{feed_id_name}}"), ), ), @@ -384,7 +455,7 @@ func roundEpochProgression(p Props) []dashboard.Option { axis.Unit("short"), ), timeseries.WithPrometheusTarget( - ``+p.OcrVersion+`_telemetry_epoch_round{`+p.PlatformOpts.LabelQuery+`feed_id_name=~"${feed_id_name}"}`, + ``+p.OcrVersion+`_telemetry_epoch_round{feed_id_name=~"${feed_id_name}"}`, prometheus.Legend("{{oracle}}"), ), ), @@ -398,7 +469,7 @@ func roundEpochProgression(p Props) []dashboard.Option { axis.Unit("short"), ), timeseries.WithPrometheusTarget( - `rate(`+p.OcrVersion+`_telemetry_round_started_total{`+p.PlatformOpts.LabelQuery+`feed_id_name=~"${feed_id_name}"}[1m])`, + `rate(`+p.OcrVersion+`_telemetry_round_started_total{feed_id_name=~"${feed_id_name}"}[1m])`, prometheus.Legend("{{oracle}}"), ), ), @@ -410,8 +481,9 @@ func roundEpochProgression(p Props) []dashboard.Option { timeseries.Axis( axis.Unit("short"), ), + timeseries.Legend(timeseries.ToTheRight), timeseries.WithPrometheusTarget( - `rate(`+p.OcrVersion+`_telemetry_ingested_total{`+p.PlatformOpts.LabelQuery+`feed_id_name=~"${feed_id_name}"}[1m])`, + `rate(`+p.OcrVersion+`_telemetry_ingested_total{feed_id_name=~"${feed_id_name}"}[1m])`, prometheus.Legend("{{oracle}}"), ), ), @@ -424,6 +496,7 @@ func New(p Props) []dashboard.Option { opts = append(opts, summary(p)...) opts = append(opts, ocrContractConfigOracle(p)...) opts = append(opts, ocrContractConfigNodes(p)...) + opts = append(opts, priceReporting(p)...) opts = append(opts, ocrContractConfigDelta(p)...) opts = append(opts, roundEpochProgression(p)...) return opts diff --git a/dashboard-lib/atlas-don/platform.go b/dashboard-lib/atlas-don/platform.go index 1f2e2e05b89..ab8443e2111 100644 --- a/dashboard-lib/atlas-don/platform.go +++ b/dashboard-lib/atlas-don/platform.go @@ -15,28 +15,20 @@ type PlatformOpts struct { func PlatformPanelOpts(platform string) PlatformOpts { po := PlatformOpts{ LabelFilters: map[string]string{ - "instance": `=~"${instance}"`, - "commit": `=~"${commit:pipe}"`, - "contract": `=~"${contract}"`, + "contract": `=~"${contract}"`, + "feed_id_name": `=~"${feed_id_name}"`, }, } switch platform { case "kubernetes": - po.LabelFilters = map[string]string{ - // TODO: sometimes I can see my PodMonitor selector, sometimes I don't - // TODO: is it prometheus-operator issue or do we really need "job" selector for k8s? - // TODO: works without it - "job": `=~"${job}"`, - "namespace": `=~"${namespace}"`, - "pod": `=~"${pod}"`, - } + po.LabelFilters["namespace"] = `=~"${namespace}"` + po.LabelFilters["job"] = `=~"${job}"` + po.LabelFilters["pod"] = `=~"${pod}"` po.LabelFilter = "job" po.LegendString = "pod" break case "docker": - po.LabelFilters = map[string]string{ - "instance": `=~"${instance}"`, - } + po.LabelFilters["instance"] = `=~"${instance}"` po.LabelFilter = "instance" po.LegendString = "instance" break diff --git a/dashboard-lib/k8s-pods/component.go b/dashboard-lib/k8s-pods/component.go index 7203fde6574..fc66cdb001b 100644 --- a/dashboard-lib/k8s-pods/component.go +++ b/dashboard-lib/k8s-pods/component.go @@ -26,14 +26,6 @@ func vars(p Props) []dashboard.Option { query.Request("label_values(namespace)"), query.Sort(query.NumericalAsc), ), - dashboard.VariableAsQuery( - "pod", - query.DataSource(p.PrometheusDataSource), - query.Multiple(), - query.IncludeAll(), - query.Request("label_values(kube_pod_container_info{namespace=\"$namespace\"}, pod)"), - query.Sort(query.NumericalAsc), - ), dashboard.VariableAsQuery( "job", query.DataSource(p.PrometheusDataSource), @@ -43,11 +35,11 @@ func vars(p Props) []dashboard.Option { query.Sort(query.NumericalAsc), ), dashboard.VariableAsQuery( - "service", + "pod", query.DataSource(p.PrometheusDataSource), query.Multiple(), query.IncludeAll(), - query.Request("label_values(up{namespace=\"$namespace\"}, service)"), + query.Request("label_values(up{namespace=\"$namespace\", job=\"$job\"}, pod)"), query.Sort(query.NumericalAsc), ), }