Skip to content

Commit d828d47

Browse files
authored
Adjust Keystone dashboard, fix port overrides in Aptos chain, remove batches in OTEL (#1759)
* remove blockchain cache and override ports only if no custom ports are provided * remove otel batching * simplify port forwarding, use only x:y format * fix docs
1 parent a196f9a commit d828d47

File tree

10 files changed

+69
-126
lines changed

10 files changed

+69
-126
lines changed

book/src/framework/components/blockchains/aptos.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ API is available on [localhost:8080](http://localhost:8080/v1)
1717
type = "aptos"
1818
image = "aptoslabs/tools:aptos-node-v1.18.0" # or aptoslabs/tools:nightly
1919
contracts_dir = "$your_dir"
20-
# expose custom ports
21-
custom_ports = ["2020", "4050:4050"]
20+
# expose custom ports, by default 8080 is API and 8081 is faucet
21+
custom_ports = ["9080:8080", "9081:9081"]
2222
# add command params
2323
docker_cmd_params = ["--skip-metadata-apply"]
2424
```

book/src/framework/components/state.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ You can also define a custom set of ports for any node.
5555

5656
[nodeset.node_specs.node]
5757
# here we defined 2 new ports to listen and mapped them to our host machine
58-
# syntax is "host:docker", if you provide only host port then we map 1-to-1
59-
custom_ports = ["14000:15000", "20000"]
58+
# syntax is "host:docker"
59+
custom_ports = ["14000:15000"]
6060
image = "public.ecr.aws/chainlink/chainlink:v2.16.0"
6161
```

framework/.changeset/v0.7.2.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Remove OTEL batches for faster metrics feedback
2+
- Fix default overrides for Aptos team

framework/cmd/observability/compose/conf/provisioning/dashboards/workflow-engine/engine.json

Lines changed: 19 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@
996996
"uid": "PBFA97CFB590B2093"
997997
},
998998
"editorMode": "code",
999-
"expr": "sum by (workflowName) (\n increase(\n platform_engine_workflow_completed_time_seconds_count{}[2m]\n )\n) / (\n sum by (workflowName) (\n increase(\n platform_engine_workflow_completed_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_earlyexit_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_error_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_timeout_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n )\n)",
999+
"expr": "sum by (workflowName) (\n increase(\n platform_engine_workflow_completed_time_seconds_count{}[1m]\n )\n) / (\n sum by (workflowName) (\n increase(\n platform_engine_workflow_completed_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_earlyexit_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_error_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_timeout_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n )\n)",
10001000
"legendFormat": "__auto",
10011001
"range": true,
10021002
"refId": "A"
@@ -1098,7 +1098,7 @@
10981098
"uid": "PBFA97CFB590B2093"
10991099
},
11001100
"editorMode": "code",
1101-
"expr": "group by (workflowName, workflowID) (rate(platform_engine_workflow_completed_time_seconds_count{}[2m]) > 0)",
1101+
"expr": "group by (workflowName, workflowID) (rate(platform_engine_workflow_completed_time_seconds_count{}[1m]) > 0)",
11021102
"legendFormat": "{{workflowName}}",
11031103
"range": true,
11041104
"refId": "A"
@@ -1196,7 +1196,7 @@
11961196
"uid": "PBFA97CFB590B2093"
11971197
},
11981198
"editorMode": "code",
1199-
"expr": "sum by (workflowName) (\n increase(\n platform_engine_workflow_earlyexit_time_seconds_count{}[2m]\n )\n) / (\n sum by (workflowName) (\n increase(\n platform_engine_workflow_completed_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_earlyexit_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_error_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_timeout_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n )\n)",
1199+
"expr": "sum by (workflowName) (\n increase(\n platform_engine_workflow_earlyexit_time_seconds_count{}[1m]\n )\n) / (\n sum by (workflowName) (\n increase(\n platform_engine_workflow_completed_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_earlyexit_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_error_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_timeout_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n )\n)",
12001200
"legendFormat": "__auto",
12011201
"range": true,
12021202
"refId": "A"
@@ -1298,7 +1298,7 @@
12981298
"uid": "PBFA97CFB590B2093"
12991299
},
13001300
"editorMode": "code",
1301-
"expr": "group by (workflowName, workflowID) (rate(platform_engine_workflow_earlyexit_time_seconds_count{}[2m]) > 0)",
1301+
"expr": "group by (workflowName, workflowID) (rate(platform_engine_workflow_earlyexit_time_seconds_count{}[1m]) > 0)",
13021302
"legendFormat": "{{workflowName}}",
13031303
"range": true,
13041304
"refId": "A"
@@ -1396,7 +1396,7 @@
13961396
"uid": "PBFA97CFB590B2093"
13971397
},
13981398
"editorMode": "code",
1399-
"expr": "sum by (workflowName) (\n increase(\n platform_engine_workflow_error_time_seconds_count{}[2m]\n )\n) / (\n sum by (workflowName) (\n increase(\n platform_engine_workflow_completed_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_earlyexit_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_error_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_timeout_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n )\n)",
1399+
"expr": "sum by (workflowName) (\n increase(\n platform_engine_workflow_error_time_seconds_count{}[1m]\n )\n) / (\n sum by (workflowName) (\n increase(\n platform_engine_workflow_completed_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_earlyexit_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_error_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_timeout_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n )\n)",
14001400
"legendFormat": "__auto",
14011401
"range": true,
14021402
"refId": "A"
@@ -1498,7 +1498,7 @@
14981498
"uid": "PBFA97CFB590B2093"
14991499
},
15001500
"editorMode": "code",
1501-
"expr": "group by (workflowName, workflowID) (rate(platform_engine_workflow_error_time_seconds_count{}[2m]) > 0)",
1501+
"expr": "group by (workflowName, workflowID) (rate(platform_engine_workflow_error_time_seconds_count{}[1m]))",
15021502
"legendFormat": "{{workflowName}}",
15031503
"range": true,
15041504
"refId": "A"
@@ -1596,7 +1596,7 @@
15961596
"uid": "PBFA97CFB590B2093"
15971597
},
15981598
"editorMode": "code",
1599-
"expr": "sum by (workflowName) (\n increase(\n platform_engine_workflow_timeout_time_seconds_count{}[2m]\n )\n) / (\n sum by (workflowName) (\n increase(\n platform_engine_workflow_completed_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_earlyexit_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_error_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_timeout_time_seconds_count{}[2m]\n ) or platform_engine_workflow_count{} * 0\n )\n)",
1599+
"expr": "sum by (workflowName) (\n increase(\n platform_engine_workflow_timeout_time_seconds_count{}[1m]\n )\n) / (\n sum by (workflowName) (\n increase(\n platform_engine_workflow_completed_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_earlyexit_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_error_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n ) + sum by (workflowName) (\n increase(\n platform_engine_workflow_timeout_time_seconds_count{}[1m]\n ) or platform_engine_workflow_count{} * 0\n )\n)",
16001600
"legendFormat": "__auto",
16011601
"range": true,
16021602
"refId": "A"
@@ -1698,7 +1698,7 @@
16981698
"uid": "PBFA97CFB590B2093"
16991699
},
17001700
"editorMode": "code",
1701-
"expr": "group by (workflowName, workflowID) (rate(platform_engine_workflow_timeout_time_seconds_count{}[2m]) > 0)",
1701+
"expr": "group by (workflowName, workflowID) (rate(platform_engine_workflow_timeout_time_seconds_count{}[1m]) > 0)",
17021702
"legendFormat": "__auto",
17031703
"range": true,
17041704
"refId": "A"
@@ -1795,7 +1795,7 @@
17951795
"uid": "PBFA97CFB590B2093"
17961796
},
17971797
"editorMode": "code",
1798-
"expr": "max(histogram_quantile(0.95, sum(increase(platform_engine_workflow_completed_time_seconds_bucket{}[15m])) by (le, workflowName, csa_public_key))) by (workflowName)",
1798+
"expr": "max(histogram_quantile(0.95, sum(increase(platform_engine_workflow_completed_time_seconds_bucket{}[1m])) by (le, workflowName, csa_public_key))) by (workflowName)",
17991799
"legendFormat": "__auto",
18001800
"range": true,
18011801
"refId": "A"
@@ -1892,7 +1892,7 @@
18921892
"uid": "PBFA97CFB590B2093"
18931893
},
18941894
"editorMode": "code",
1895-
"expr": "max(histogram_quantile(0.99, sum(increase(platform_engine_workflow_completed_time_seconds_bucket{}[15m])) by (le, workflowName, csa_public_key))) by (workflowName)",
1895+
"expr": "max(histogram_quantile(0.99, sum(increase(platform_engine_workflow_completed_time_seconds_bucket{}[1m])) by (le, workflowName, csa_public_key))) by (workflowName)",
18961896
"legendFormat": "__auto",
18971897
"range": true,
18981898
"refId": "A"
@@ -1989,7 +1989,7 @@
19891989
"uid": "PBFA97CFB590B2093"
19901990
},
19911991
"editorMode": "code",
1992-
"expr": "max(histogram_quantile(0.95, sum(increase(platform_engine_workflow_earlyexit_time_seconds_bucket{}[15m])) by (le, workflowName, csa_public_key))) by (workflowName)",
1992+
"expr": "max(histogram_quantile(0.95, sum(increase(platform_engine_workflow_earlyexit_time_seconds_bucket{}[1m])) by (le, workflowName, csa_public_key))) by (workflowName)",
19931993
"legendFormat": "__auto",
19941994
"range": true,
19951995
"refId": "A"
@@ -2086,7 +2086,7 @@
20862086
"uid": "PBFA97CFB590B2093"
20872087
},
20882088
"editorMode": "code",
2089-
"expr": "max(histogram_quantile(0.99, sum(increase(platform_engine_workflow_earlyexit_time_seconds_bucket{}[15m])) by (le, workflowName, csa_public_key))) by (workflowName)",
2089+
"expr": "max(histogram_quantile(0.99, sum(increase(platform_engine_workflow_earlyexit_time_seconds_bucket{}[1m])) by (le, workflowName, csa_public_key))) by (workflowName)",
20902090
"legendFormat": "__auto",
20912091
"range": true,
20922092
"refId": "A"
@@ -2183,7 +2183,7 @@
21832183
"uid": "PBFA97CFB590B2093"
21842184
},
21852185
"editorMode": "code",
2186-
"expr": "max(histogram_quantile(0.95, sum(increase(platform_engine_workflow_error_time_seconds_bucket{}[15m])) by (le, workflowName, csa_public_key))) by (workflowName)",
2186+
"expr": "max(histogram_quantile(0.95, sum(increase(platform_engine_workflow_error_time_seconds_bucket{}[1m])) by (le, workflowName, csa_public_key))) by (workflowName)",
21872187
"legendFormat": "__auto",
21882188
"range": true,
21892189
"refId": "A"
@@ -2280,7 +2280,7 @@
22802280
"uid": "PBFA97CFB590B2093"
22812281
},
22822282
"editorMode": "code",
2283-
"expr": "max(histogram_quantile(0.99, sum(increase(platform_engine_workflow_error_time_seconds_bucket{}[15m])) by (le, workflowName, csa_public_key))) by (workflowName)",
2283+
"expr": "max(histogram_quantile(0.99, sum(increase(platform_engine_workflow_error_time_seconds_bucket{}[1m])) by (le, workflowName, csa_public_key))) by (workflowName)",
22842284
"legendFormat": "__auto",
22852285
"range": true,
22862286
"refId": "A"
@@ -2377,7 +2377,7 @@
23772377
"uid": "PBFA97CFB590B2093"
23782378
},
23792379
"editorMode": "code",
2380-
"expr": "max(histogram_quantile(0.95, sum(increase(platform_engine_workflow_timeout_time_seconds_bucket{}[15m])) by (le, workflowName, csa_public_key))) by (workflowName)",
2380+
"expr": "max(histogram_quantile(0.95, sum(increase(platform_engine_workflow_timeout_time_seconds_bucket{}[1m])) by (le, workflowName, csa_public_key))) by (workflowName)",
23812381
"legendFormat": "__auto",
23822382
"range": true,
23832383
"refId": "A"
@@ -2474,7 +2474,7 @@
24742474
"uid": "PBFA97CFB590B2093"
24752475
},
24762476
"editorMode": "code",
2477-
"expr": "max(histogram_quantile(0.99, sum(increase(platform_engine_workflow_timeout_time_seconds_bucket{}[15m])) by (le, workflowName, csa_public_key))) by (workflowName)",
2477+
"expr": "max(histogram_quantile(0.99, sum(increase(platform_engine_workflow_timeout_time_seconds_bucket{}[1m])) by (le, workflowName, csa_public_key))) by (workflowName)",
24782478
"legendFormat": "__auto",
24792479
"range": true,
24802480
"refId": "A"
@@ -3177,7 +3177,7 @@
31773177
"type": "timeseries"
31783178
}
31793179
],
3180-
"refresh": "30s",
3180+
"refresh": "10s",
31813181
"schemaVersion": 38,
31823182
"style": "dark",
31833183
"tags": [
@@ -3188,75 +3188,10 @@
31883188
" Performance"
31893189
],
31903190
"templating": {
3191-
"list": [
3192-
{
3193-
"current": {
3194-
"selected": false,
3195-
"text": [
3196-
"otel-collector"
3197-
],
3198-
"value": [
3199-
"otel-collector"
3200-
]
3201-
},
3202-
"datasource": {
3203-
"type": "prometheus",
3204-
"uid": "PBFA97CFB590B2093"
3205-
},
3206-
"definition": "label_values(up,job)",
3207-
"description": "",
3208-
"hide": 0,
3209-
"includeAll": true,
3210-
"label": "Job",
3211-
"multi": true,
3212-
"name": "job",
3213-
"options": [],
3214-
"query": {
3215-
"query": "label_values(up,job)",
3216-
"refId": "PrometheusVariableQueryEditor-VariableQuery"
3217-
},
3218-
"refresh": 1,
3219-
"regex": "",
3220-
"skipUrlSync": false,
3221-
"sort": 0,
3222-
"type": "query"
3223-
},
3224-
{
3225-
"current": {
3226-
"selected": false,
3227-
"text": [
3228-
"All"
3229-
],
3230-
"value": [
3231-
"$__all"
3232-
]
3233-
},
3234-
"datasource": {
3235-
"type": "prometheus",
3236-
"uid": "PBFA97CFB590B2093"
3237-
},
3238-
"definition": "label_values(platform_engine_workflow_count,workflowID)",
3239-
"description": "",
3240-
"hide": 0,
3241-
"includeAll": true,
3242-
"label": "WorkflowID",
3243-
"multi": true,
3244-
"name": "workflowID",
3245-
"options": [],
3246-
"query": {
3247-
"query": "label_values(platform_engine_workflow_count,workflowID)",
3248-
"refId": "PrometheusVariableQueryEditor-VariableQuery"
3249-
},
3250-
"refresh": 1,
3251-
"regex": "",
3252-
"skipUrlSync": false,
3253-
"sort": 0,
3254-
"type": "query"
3255-
}
3256-
]
3191+
"list": []
32573192
},
32583193
"time": {
3259-
"from": "now-30m",
3194+
"from": "now-5m",
32603195
"to": "now"
32613196
},
32623197
"timepicker": {},

framework/cmd/observability/compose/otel.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,10 @@ service:
2929
pipelines:
3030
traces:
3131
receivers: [otlp]
32-
processors: [batch]
3332
exporters: [debug, otlp]
3433
logs:
3534
receivers: [otlp]
36-
processors: [batch]
3735
exporters: [debug, otlphttp/logs]
3836
metrics:
3937
receivers: [otlp]
40-
processors: [batch]
4138
exporters: [debug, prometheus]

framework/components/blockchain/aptos.go

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"path/filepath"
7+
"strings"
78

89
"github.com/docker/docker/api/types/container"
910
"github.com/testcontainers/testcontainers-go"
@@ -12,6 +13,11 @@ import (
1213
"github.com/smartcontractkit/chainlink-testing-framework/framework"
1314
)
1415

16+
const (
17+
DefaultAptosAPIPort = "8080"
18+
DefaultAptosFaucetPort = "8081"
19+
)
20+
1521
var (
1622
DefaultAptosAccount = "0xa337b42bd0eecf8fb59ee5929ea4541904b3c35a642040223f3d26ab57f59d6e"
1723
DefaultAptosPrivateKey = "0xd477c65f88ed9e6d4ec6e2014755c3cfa3e0c44e521d0111a02868c5f04c41d4"
@@ -21,9 +27,15 @@ func defaultAptos(in *Input) {
2127
if in.Image == "" {
2228
in.Image = "aptoslabs/tools:aptos-node-v1.27.2"
2329
}
24-
framework.L.Warn().Msg("Aptos node API can only be exposed on port 8080!")
25-
in.CustomPorts = append(in.CustomPorts, "8080:8080", "8081:8081")
26-
in.Port = "8080"
30+
framework.L.Warn().Msgf("Aptos node API can only be exposed on port %s!", DefaultAptosAPIPort)
31+
if in.Port == "" {
32+
// enable default API exposed port
33+
in.Port = DefaultAptosAPIPort
34+
}
35+
if in.CustomPorts == nil {
36+
// enable default API and faucet forwarding
37+
in.CustomPorts = append(in.CustomPorts, fmt.Sprintf("%s:%s", in.Port, DefaultAptosAPIPort), fmt.Sprintf("%s:%s", DefaultAptosFaucetPort, DefaultAptosFaucetPort))
38+
}
2739
}
2840

2941
func newAptos(in *Input) (*Output, error) {
@@ -40,6 +52,7 @@ func newAptos(in *Input) (*Output, error) {
4052
if err != nil {
4153
return nil, err
4254
}
55+
exposedPorts = append(exposedPorts, in.Port)
4356

4457
cmd := []string{
4558
"aptos",
@@ -100,13 +113,20 @@ func newAptos(in *Input) (*Output, error) {
100113
if err != nil {
101114
return nil, err
102115
}
116+
// expose default API port if remapped
117+
var exposedAPIPort string
118+
for _, portPair := range in.CustomPorts {
119+
if strings.Contains(portPair, fmt.Sprintf(":%s", DefaultAptosAPIPort)) {
120+
exposedAPIPort = strings.Split(portPair, ":")[0]
121+
}
122+
}
103123
return &Output{
104124
UseCache: true,
105125
Family: "aptos",
106126
ContainerName: containerName,
107127
Nodes: []*Node{
108128
{
109-
ExternalHTTPUrl: fmt.Sprintf("http://%s:%s", host, in.Port),
129+
ExternalHTTPUrl: fmt.Sprintf("http://%s:%s", host, exposedAPIPort),
110130
InternalHTTPUrl: fmt.Sprintf("http://%s:%s", containerName, in.Port),
111131
},
112132
},

framework/components/blockchain/blockchain.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ type Node struct {
5858

5959
// NewBlockchainNetwork this is an abstraction that can spin up various blockchain network simulators
6060
func NewBlockchainNetwork(in *Input) (*Output, error) {
61-
if in.Out != nil && in.Out.UseCache {
62-
return in.Out, nil
63-
}
6461
var out *Output
6562
var err error
6663
switch in.Type {

0 commit comments

Comments
 (0)