Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCIP dashboard components #12463

Merged
merged 3 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions charts/chainlink-cluster/dashboard/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/K-Phoen/grabana/dashboard"
lib "github.com/smartcontractkit/chainlink/dashboard-lib/lib"
core_don "github.com/smartcontractkit/chainlink/dashboard-lib/lib/core-don"
core_ocrv2_ccip "github.com/smartcontractkit/chainlink/dashboard-lib/lib/core-ocrv2-ccip"
k8spods "github.com/smartcontractkit/chainlink/dashboard-lib/lib/k8s-pods"
waspdb "github.com/smartcontractkit/wasp/dashboard"
)
Expand All @@ -28,6 +29,22 @@ func main() {
},
),
)
db.Add(
core_ocrv2_ccip.New(
core_ocrv2_ccip.Props{
PrometheusDataSource: cfg.DataSources.Prometheus,
PluginName: "CCIPCommit",
},
),
)
db.Add(
core_ocrv2_ccip.New(
core_ocrv2_ccip.Props{
PrometheusDataSource: cfg.DataSources.Prometheus,
PluginName: "CCIPExecution",
},
),
)
if cfg.Platform == "kubernetes" {
db.Add(
k8spods.New(
Expand Down
6 changes: 0 additions & 6 deletions charts/chainlink-cluster/dashboard/tests/.gitignore

This file was deleted.

17 changes: 0 additions & 17 deletions charts/chainlink-cluster/dashboard/tests/package.json

This file was deleted.

33 changes: 0 additions & 33 deletions charts/chainlink-cluster/dashboard/tests/playwright.config.ts

This file was deleted.

57 changes: 0 additions & 57 deletions charts/chainlink-cluster/dashboard/tests/pnpm-lock.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ dashboard
|- lib
|- component_1
|- component.go
|- component.spec.ts
|- component_2
|- component.go
|- component.spec.ts
|- go.mod
|- go.sum
```
Expand All @@ -20,8 +18,6 @@ Each component should contain rows, logic and unique variables in `component.go`

Components should be imported from this module, see [example](../charts/chainlink-cluster/dashboard/cmd/deploy.go)

`component.spec.ts` is a Playwright test step that can be used when testing project [dashboards](../charts/chainlink-cluster/dashboard/tests/specs/core-don.spec.ts)

## How to convert from JSON using Grabana codegen utility
1. Download Grabana binary [here](https://github.com/K-Phoen/grabana/releases)
2. ./bin/grabana convert-go -i dashboard.json > lib/my_new_component/rows.go
Expand Down
3 changes: 0 additions & 3 deletions dashboard/index.ts

This file was deleted.

149 changes: 113 additions & 36 deletions dashboard/lib/core-don/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,108 +159,185 @@ func logPollerRow(p Props) []dashboard.Option {
return []dashboard.Option{
dashboard.Row("LogPoller",
row.Collapse(),
row.WithStat(
"Goroutines",
stat.DataSource(p.PrometheusDataSource),
stat.Text(stat.TextValueAndName),
stat.Orientation(stat.OrientationAuto),
stat.Height("200px"),
stat.TitleFontSize(30),
stat.ValueFontSize(30),
stat.Span(6),
stat.Text("Goroutines"),
stat.WithPrometheusTarget(
`count(count by (evmChainID) (log_poller_query_duration_sum{job=~"$instance"}))`,
prometheus.Legend("Goroutines"),
),
),
row.WithTimeSeries(
"LogPoller RPS",
timeseries.Span(4),
"RPS",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("requests"),
),
timeseries.WithPrometheusTarget(
`avg(sum(rate(log_poller_query_duration_count{`+p.PlatformOpts.LabelQuery+`evmChainID=~"$evmChainID"}[$__rate_interval])) by (query, `+p.PlatformOpts.LabelFilter+`)) by (query)`,
prometheus.Legend("{{query}}"),
`avg by (query) (sum by (query, job) (rate(log_poller_query_duration_count{job=~"$instance", evmChainID=~"$evmChainID"}[$__rate_interval])))`,
prometheus.Legend("{{query}} - {{job}}"),
),
timeseries.WithPrometheusTarget(
`avg(sum(rate(log_poller_query_duration_count{`+p.PlatformOpts.LabelFilter+`=~"$instance", evmChainID=~"$evmChainID"}[$__rate_interval]))) by (`+p.PlatformOpts.LabelFilter+`)`,
`avg (sum by(job) (rate(log_poller_query_duration_count{job=~"$instance", evmChainID=~"$evmChainID"}[$__rate_interval])))`,
prometheus.Legend("Total"),
),
),
row.WithTimeSeries(
"LogPoller Logs Number Returned",
timeseries.Span(4),
"RPS by type",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("requests"),
),
timeseries.WithPrometheusTarget(
`log_poller_query_dataset_size{`+p.PlatformOpts.LabelQuery+`evmChainID=~"$evmChainID"}`,
prometheus.Legend("{{query}} : {{type}}"),
`avg by (type) (sum by (type, job) (rate(log_poller_query_duration_count{job=~"$instance", evmChainID=~"$evmChainID"}[$__rate_interval])))`,
),
),
row.WithTimeSeries(
"LogPoller Average Logs Number Returned",
timeseries.Span(4),
"Avg number of logs returned",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("logs"),
),
timeseries.WithPrometheusTarget(
`avg(log_poller_query_dataset_size{`+p.PlatformOpts.LabelQuery+`evmChainID=~"$evmChainID"}) by (query)`,
prometheus.Legend("{{query}}"),
`avg by (query) (log_poller_query_dataset_size{job=~"$instance", evmChainID=~"$evmChainID"})`,
prometheus.Legend("{{query}} - {{job}}"),
),
),
row.WithTimeSeries(
"LogPoller Max Logs Number Returned",
timeseries.Span(4),
"Max number of logs returned",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("logs"),
),
timeseries.WithPrometheusTarget(
`max(log_poller_query_dataset_size{`+p.PlatformOpts.LabelQuery+`evmChainID=~"$evmChainID"}) by (query)`,
prometheus.Legend("{{query}}"),
`max by (query) (log_poller_query_dataset_size{job=~"$instance", evmChainID=~"$evmChainID"})`,
prometheus.Legend("{{query}} - {{job}}"),
),
),
row.WithTimeSeries(
"LogPoller Logs Number Returned by Chain",
timeseries.Span(4),
"Logs returned by chain",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("logs"),
),
timeseries.WithPrometheusTarget(
`max(log_poller_query_dataset_size{`+p.PlatformOpts.LabelQuery+`}) by (evmChainID)`,
`max by (evmChainID) (log_poller_query_dataset_size{job=~"$instance", evmChainID=~"$evmChainID"})`,
prometheus.Legend("{{evmChainID}}"),
),
),
row.WithTimeSeries(
"LogPoller Queries Duration Avg",
timeseries.Span(4),
"Queries duration by type (0.5 perc)",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("ms"),
),
timeseries.WithPrometheusTarget(
`(sum(rate(log_poller_query_duration_sum{`+p.PlatformOpts.LabelQuery+`evmChainID=~"$evmChainID"}[$__rate_interval])) by (query) / sum(rate(log_poller_query_duration_count{`+p.PlatformOpts.LabelQuery+`}[$__rate_interval])) by (query)) / 1e6`,
`histogram_quantile(0.5, sum(rate(log_poller_query_duration_bucket{job=~"$instance", evmChainID=~"$evmChainID"}[$__rate_interval])) by (le, query)) / 1e6`,
prometheus.Legend("{{query}}"),
),
),
row.WithTimeSeries(
"LogPoller Queries Duration p99",
timeseries.Span(4),
"queries duration by type (0.9 perc)",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("ms"),
),
timeseries.WithPrometheusTarget(
`histogram_quantile(0.99, sum(rate(log_poller_query_duration_bucket{`+p.PlatformOpts.LabelQuery+`evmChainID=~"$evmChainID"}[$__rate_interval])) by (le, query)) / 1e6`,
`histogram_quantile(0.9, sum(rate(log_poller_query_duration_bucket{job=~"$instance", evmChainID=~"$evmChainID"}[$__rate_interval])) by (le, query)) / 1e6`,
prometheus.Legend("{{query}}"),
),
),
row.WithTimeSeries(
"LogPoller Queries Duration p95",
timeseries.Span(4),
"Queries duration by type (0.99 perc)",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("ms"),
),
timeseries.WithPrometheusTarget(
`histogram_quantile(0.95, sum(rate(log_poller_query_duration_bucket{`+p.PlatformOpts.LabelQuery+`evmChainID=~"$evmChainID"}[$__rate_interval])) by (le, query)) / 1e6`,
`histogram_quantile(0.99, sum(rate(log_poller_query_duration_bucket{job=~"$instance", evmChainID=~"$evmChainID"}[$__rate_interval])) by (le, query)) / 1e6`,
prometheus.Legend("{{query}}"),
),
),
row.WithTimeSeries(
"LogPoller Queries Duration p90",
timeseries.Span(4),
"Queries duration by chain (0.99 perc)",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("ms"),
),
timeseries.WithPrometheusTarget(
`histogram_quantile(0.95, sum(rate(log_poller_query_duration_bucket{`+p.PlatformOpts.LabelQuery+`evmChainID=~"$evmChainID"}[$__rate_interval])) by (le, query)) / 1e6`,
`histogram_quantile(0.99, sum(rate(log_poller_query_duration_bucket{job=~"$instance", evmChainID=~"$evmChainID"}[$__rate_interval])) by (le, evmChainID)) / 1e6`,
prometheus.Legend("{{query}}"),
),
),
row.WithTimeSeries(
"LogPoller Queries Duration Median",
timeseries.Span(4),
"Number of logs inserted",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("logs"),
),
timeseries.WithPrometheusTarget(
`histogram_quantile(0.5, sum(rate(log_poller_query_duration_bucket{`+p.PlatformOpts.LabelQuery+`evmChainID=~"$evmChainID"}[$__rate_interval])) by (le, query)) / 1e6`,
prometheus.Legend("{{query}}"),
`avg by (evmChainID) (log_poller_logs_inserted{job=~"$instance", evmChainID=~"$evmChainID"})`,
prometheus.Legend("{{evmChainID}}"),
),
),
row.WithTimeSeries(
"Logs insertion rate",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.WithPrometheusTarget(
`avg by (evmChainID) (rate(log_poller_logs_inserted{job=~"$instance", evmChainID=~"$evmChainID"}[$__rate_interval]))`,
prometheus.Legend("{{evmChainID}}"),
),
),
row.WithTimeSeries(
"Number of blocks inserted",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.Axis(
axis.Unit("blocks"),
),
timeseries.WithPrometheusTarget(
`avg by (evmChainID) (log_poller_blocks_inserted{job=~"$instance", evmChainID=~"$evmChainID"})`,
prometheus.Legend("{{evmChainID}}"),
),
),
row.WithTimeSeries(
"Blocks insertion rate",
timeseries.Span(6),
timeseries.Height("200px"),
timeseries.DataSource(p.PrometheusDataSource),
timeseries.WithPrometheusTarget(
`avg by (evmChainID) (rate(log_poller_blocks_inserted{job=~"$instance", evmChainID=~"$evmChainID"}[$__rate_interval]))`,
prometheus.Legend("{{evmChainID}}"),
),
),
),
Expand Down
Loading
Loading