Skip to content

Commit c360a7b

Browse files
authored
Merge pull request #652 from input-output-hk/ch1bo/live-prototype-visualization
Visualizer: support live logs from Loki
2 parents 36b82ef + 8a18c24 commit c360a7b

File tree

10 files changed

+782
-70
lines changed

10 files changed

+782
-70
lines changed

ui/README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,47 @@ Then update `public/scenarios.json` accordingly:
6666
}
6767
```
6868

69-
Now add that
69+
## Add a live Loki streaming scenario
70+
71+
For live visualization of node logs, you can configure scenarios that connect to a Loki instance via WebSocket. This allows real-time monitoring of running Cardano nodes.
72+
73+
First, ensure your Loki instance is running and accessible, for example by following the [leios-demo](https://github.com/input-output-hk/leios-demo/) instructions.
74+
Then add a scenario with a `loki` field instead of `trace` to `public/scenarios.json`:
75+
76+
```json
77+
{
78+
"scenarios": [
79+
{
80+
"name": "Leios Demo 202511",
81+
"topology": "topologies/prototype.yaml",
82+
"duration": 300,
83+
"loki": "localhost:3100"
84+
}
85+
]
86+
}
87+
```
88+
89+
## Configuration
90+
91+
Scenarios support two modes:
92+
93+
- **Stored traces**: Use the `trace` field pointing to a JSONL file (optionally gzipped)
94+
- **Live streaming**: Use the `loki` field with host:port of your Loki instance
95+
96+
Both modes require a `topology` field specifying the network topology YAML file and a `duration` defining the amount of loaded data.
97+
98+
### Auto-starting scenarios
99+
100+
Scenarios can be auto-loaded/-connected using a URL query parameter:
101+
102+
```
103+
?scenario=<index>
104+
```
105+
106+
Where `<index>` is the zero-based index of the scenario in the scenarios.json array. For example:
107+
108+
- `?scenario=0` - Auto-loads the first scenario (e.g., "200 TxkB/s")
109+
- `?scenario=1` - Auto-loads the second scenario (e.g., "1 TxkB/s")
110+
- `?scenario=2` - Auto-connects to the third scenario (e.g., "Leios Demo 202511")
111+
112+
This is useful for direct links, bookmarking, or embedding specific scenarios.

ui/public/scenarios.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
"topology": "topologies/small.yaml",
1212
"duration": 120,
1313
"trace": "traces/small-1txkbs-nocpu.jsonl.gz"
14+
},
15+
{
16+
"name": "Leios Demo 202511",
17+
"topology": "topologies/prototype.yaml",
18+
"duration": 300,
19+
"loki": "localhost:3100"
1420
}
1521
]
1622
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
nodes:
2+
UpstreamNode:
3+
stake: 1
4+
location:
5+
- 0
6+
- 0
7+
producers: {}
8+
Node0:
9+
stake: 0
10+
location:
11+
- 0
12+
- 100
13+
producers:
14+
UpstreamNode:
15+
latency-ms: 200.0
16+
DownstreamNode:
17+
stake: 0
18+
location:
19+
- 0
20+
- 200
21+
producers:
22+
Node0:
23+
latency-ms: 200.0

0 commit comments

Comments
 (0)