Skip to content

Commit

Permalink
RE-2081 All core metrics dashboard for CRIB (#11396)
Browse files Browse the repository at this point in the history
* complete core metrics

* all core metrics

* go mod tidy

* revert go mod

* extend wasp dashboard for load tests

* run OCRv1 on devspace (#11417)

* run OCRv1 on devspace

* fix go.mod

* fix goimports

* remove external charts

* dynamic nodes connection in config

* try the same replaces from integration-tests

* fix go.sum
  • Loading branch information
skudasov authored Nov 30, 2023
1 parent 3a58f94 commit 44659b1
Show file tree
Hide file tree
Showing 21 changed files with 3,555 additions and 59 deletions.
19 changes: 5 additions & 14 deletions charts/chainlink-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,15 @@ Destroy the cluster
devspace purge
```

If you need to run some system level tests inside k8s use `runner` profile:
```
devspace dev -p runner
```
## Running load tests
Check this [doc](../../integration-tests/load/ocr/README.md)

If you used `devspace dev ...` always use `devspace reset pods` to switch the pods back

## Debug existing cluster
If you need to debug CL node that is already deployed change `dev.app.container` and `dev.app.labelSelector` in [devspace.yaml](devspace.yaml) if they are not default and run:
```
devspace dev -p node
or
devspace dev -p runner
```

## Automatic file sync
Expand All @@ -85,7 +81,7 @@ helm install -f values-raw-helm.yaml cl-cluster .
```
Forward all apps (in another terminal)
```
sudo kubefwd svc
sudo kubefwd svc -n cl-cluster
```
Then you can connect and run your tests

Expand Down Expand Up @@ -126,14 +122,9 @@ export GRAFANA_URL=...
export GRAFANA_TOKEN=...
export LOKI_DATA_SOURCE_NAME=Loki
export PROMETHEUS_DATA_SOURCE_NAME=Thanos
export DASHBOARD_FOLDER=CLClusterEphemeralDevspace
export DASHBOARD_FOLDER=CRIB
export DASHBOARD_NAME=ChainlinkCluster
cd dashboard/cmd && go run dashboard_deploy.go
```
Open Grafana folder `CLClusterEphemeralDevspace` and find dashboard `ChainlinkCluster`

If you'd like to add more metrics or verify that all of them are added you can have the full list using IDE search or `ripgrep`:
```
rg -U ".*promauto.*\n.*Name: \"(.*)\"" ../.. > metrics.txt
```
Open Grafana folder `CRIB` and find dashboard `ChainlinkCluster`
12 changes: 12 additions & 0 deletions charts/chainlink-cluster/connect.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace = "cl-cluster"
network_name = "geth"
network_chain_id = 1337
network_private_key = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
network_ws_url = "ws://geth:8546"
network_http_url = "http://geth:8544"
cl_nodes_num = 6
cl_node_url_template = "http://app-node-%d:6688"
cl_node_internal_dns_record_template = "app-node-%d"
cl_node_user = "[email protected]"
cl_node_password = "fj293fbBnlQ!f9vNs"
mockserver_url = "http://app-mockserver:1080"
13 changes: 9 additions & 4 deletions charts/chainlink-cluster/dashboard/cmd/dashboard_deploy.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package main

import (
"context"
"os"

"github.com/smartcontractkit/chainlink/v2/dashboard/dashboard"
"github.com/smartcontractkit/wasp"
)

func main() {
ctx := context.Background()
name := os.Getenv("DASHBOARD_NAME")
if name == "" {
panic("DASHBOARD_NAME must be provided")
Expand All @@ -17,6 +16,7 @@ func main() {
if ldsn == "" {
panic("DATA_SOURCE_NAME must be provided")
}
os.Setenv("DATA_SOURCE_NAME", ldsn)
pdsn := os.Getenv("PROMETHEUS_DATA_SOURCE_NAME")
if ldsn == "" {
panic("DATA_SOURCE_NAME must be provided")
Expand All @@ -34,11 +34,16 @@ func main() {
panic("GRAFANA_TOKEN must be provided")
}
// if you'll use this dashboard base in other projects, you can add your own opts here to extend it
db, err := dashboard.NewCLClusterDashboard(name, ldsn, pdsn, dbf, grafanaURL, grafanaToken, nil)
db, err := dashboard.NewCLClusterDashboard(6, name, ldsn, pdsn, dbf, grafanaURL, grafanaToken, nil)
if err != nil {
panic(err)
}
if err := db.Deploy(ctx); err != nil {
// here we are extending load testing dashboard with core metrics, for example
wdb, err := wasp.NewDashboard(nil, db.Opts())
if err != nil {
panic(err)
}
if _, err := wdb.Deploy(); err != nil {
panic(err)
}
}
Loading

0 comments on commit 44659b1

Please sign in to comment.