Skip to content

Commit

Permalink
feat(dashboard): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Atrax1 committed Apr 11, 2024
1 parent 39bd709 commit 0cfb8f9
Show file tree
Hide file tree
Showing 5 changed files with 272 additions and 210 deletions.
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
30 changes: 16 additions & 14 deletions charts/chainlink-cluster/dashboard/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
}
Expand Down
Loading

0 comments on commit 0cfb8f9

Please sign in to comment.