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

feat(dashboard): create DON dashboard #12738

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8698e76
feat(dashboard): add DON ocr contract panels
Atrax1 Mar 13, 2024
87a0dd3
feat(dashboard): add panels included env var
Atrax1 Mar 19, 2024
40b3d18
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
Atrax1 Mar 19, 2024
9736ff0
feat(dashboard): merge conflict
Atrax1 Mar 21, 2024
8df2da0
feat(dashboard): add panels for round epoch progression
Atrax1 Mar 21, 2024
f395850
feat(dashboard): add summary don panels
Atrax1 Mar 27, 2024
39bd709
merge conflict
Atrax1 Apr 8, 2024
0cfb8f9
feat(dashboard): cleanup
Atrax1 Apr 11, 2024
0f6cde1
chore: modify sonarkube code duplication exclusion
Atrax1 Apr 11, 2024
c9167a4
Merge branch 'develop' into BCF-3054-create-sub-components-for-don-va…
Atrax1 Apr 11, 2024
0ffba95
feat(dashboard): delete dashboard
Atrax1 Apr 12, 2024
108920f
feat(dashboard): adapt for multiple ocr versions
Atrax1 Apr 12, 2024
6fb5cf5
feat(dashboard): DON dashboard for all ocr versions
Atrax1 Apr 16, 2024
8a3deb9
Merge branch 'BCF-3054-create-sub-components-for-don-variables-and-pa…
Atrax1 Apr 16, 2024
d2ec1bc
Merge branch 'develop' into BCF-3054-create-sub-components-for-don-va…
Atrax1 Apr 16, 2024
b0d2b63
feat(dashbord): separated PR for core components
Atrax1 Apr 16, 2024
512704d
Merge branch 'BCF-3054-create-sub-components-for-don-variables-and-pa…
Atrax1 Apr 16, 2024
4217618
feat(dashboard): correct escaping for k8s vars
Atrax1 Apr 16, 2024
0daea25
Merge branch 'develop' into BCF-3054-create-sub-components-for-don-va…
Atrax1 Apr 16, 2024
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
5 changes: 4 additions & 1 deletion charts/chainlink-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=...
Expand All @@ -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
Expand Down
19 changes: 19 additions & 0 deletions charts/chainlink-cluster/dashboard/cmd/delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
lib "github.com/smartcontractkit/chainlink/dashboard-lib"
)

func main() {
cfg := lib.ReadEnvDeployOpts()
db := lib.NewDashboard(cfg.Name, cfg, nil)
err := db.Delete()
if err != nil {
lib.L.Fatal().Err(err).Msg("failed to delete the dashboard")
}
lib.L.Info().
Str("Name", db.Name).
Str("GrafanaURL", db.DeployOpts.GrafanaURL).
Str("GrafanaFolder", db.DeployOpts.GrafanaFolder).
Msg("Dashboard deleted")
}
47 changes: 31 additions & 16 deletions charts/chainlink-cluster/dashboard/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,48 @@ package main
import (
"github.com/K-Phoen/grabana/dashboard"
lib "github.com/smartcontractkit/chainlink/dashboard-lib"
atlas_don "github.com/smartcontractkit/chainlink/dashboard-lib/atlas-don"
core_don "github.com/smartcontractkit/chainlink/dashboard-lib/core-don"
k8spods "github.com/smartcontractkit/chainlink/dashboard-lib/k8s-pods"
waspdb "github.com/smartcontractkit/wasp/dashboard"
)

const (
DashboardName = "Chainlink Cluster (DON)"
"strings"
)

func main() {
cfg := lib.ReadEnvDeployOpts()
db := lib.NewDashboard(DashboardName, cfg,
db := lib.NewDashboard(cfg.Name, cfg,
[]dashboard.Option{
dashboard.AutoRefresh("10s"),
dashboard.Tags([]string{"generated"}),
},
)
db.Add(
core_don.New(
core_don.Props{
PrometheusDataSource: cfg.DataSources.Prometheus,
PlatformOpts: core_don.PlatformPanelOpts(cfg.Platform),
},
),
)
if len(cfg.PanelsIncluded) == 0 || cfg.PanelsIncluded["core"] {
db.Add(
core_don.New(
core_don.Props{
PrometheusDataSource: cfg.DataSources.Prometheus,
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 {
if strings.Contains(key, "ocr") {
db.Add(
atlas_don.New(
atlas_don.Props{
PrometheusDataSource: cfg.DataSources.Prometheus,
PlatformOpts: atlas_don.PlatformPanelOpts(cfg.Platform, key),
OcrVersion: key,
},
),
)
}
}
}
if cfg.Platform == "kubernetes" {
db.Add(
k8spods.New(
Expand All @@ -38,13 +55,11 @@ func main() {
),
)
}
// TODO: refactor as a component later
addWASPRows(db, cfg)
if err := db.Deploy(); err != nil {
lib.L.Fatal().Err(err).Msg("failed to deploy the dashboard")
}
lib.L.Info().
Str("Name", DashboardName).
Str("Name", db.Name).
Str("GrafanaURL", db.DeployOpts.GrafanaURL).
Str("GrafanaFolder", db.DeployOpts.GrafanaFolder).
Msg("Dashboard deployed")
Expand Down
Loading
Loading