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

RE-2081 All core metrics dashboard for CRIB #11396

Merged
merged 11 commits into from
Nov 30, 2023
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
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
Loading