Skip to content

Commit eea1aa8

Browse files
authored
Merge pull request #371 from genlayerlabs/docs/node/v0.5.7
docs: sync documentation from genlayer-node v0.5.7
2 parents c074800 + 2f99cc9 commit eea1aa8

15 files changed

+1063
-95
lines changed

.github/scripts/doc-generator.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,33 @@ run_doc_generation() {
4747
fi
4848
echo "::endgroup::"
4949

50+
echo "::group::Running node-update-monitoring-docker-compose"
51+
if npm run node-update-monitoring-docker-compose; then
52+
echo "✅ Updated alloy service in monitoring page"
53+
else
54+
echo "❌ node-update-monitoring-docker-compose failed"
55+
failed=true
56+
fi
57+
echo "::endgroup::"
58+
59+
echo "::group::Running node-update-monitoring-alloy-config"
60+
if npm run node-update-monitoring-alloy-config; then
61+
echo "✅ Updated alloy config in monitoring page"
62+
else
63+
echo "❌ node-update-monitoring-alloy-config failed"
64+
failed=true
65+
fi
66+
echo "::endgroup::"
67+
68+
echo "::group::Running node-update-greybox"
69+
if npm run node-update-greybox; then
70+
echo "✅ Updated greybox section in genvm configuration"
71+
else
72+
echo "❌ node-update-greybox failed"
73+
failed=true
74+
fi
75+
echo "::endgroup::"
76+
5077
echo "::group::Running node-generate-api-docs"
5178
if npm run node-generate-api-docs; then
5279
echo "✅ Generated API documentation"

.github/workflows/check-node-docs-sync.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
npm run node-update-setup-guide
2929
npm run node-update-config
3030
npm run node-update-docker-compose
31+
npm run node-update-monitoring-docker-compose
32+
npm run node-update-monitoring-alloy-config
33+
npm run node-update-greybox
3134
npm run node-generate-api-docs
3235
3336
- name: Check for uncommitted changes

.github/workflows/sync-docs-from-node.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
needs: prepare
9393
strategy:
9494
matrix:
95-
sync_type: [changelog, config, config_asimov, config_bradbury, docker_compose, api_gen, api_debug, api_ops]
95+
sync_type: [changelog, config, config_asimov, config_bradbury, docker_compose, docker_compose_monitoring, alloy_config, greybox_setup, api_gen, api_debug, api_ops]
9696
fail-fast: false
9797
steps:
9898
- name: Checkout documentation repository
@@ -118,6 +118,8 @@ jobs:
118118
configs/node/asimov.yaml.example
119119
configs/node/bradbury.yaml.example
120120
release/docker-compose.yaml
121+
release/alloy-config.river
122+
release/greybox-setup-guide.md
121123
sparse-checkout-cone-mode: true
122124
path: source-repo
123125
ref: ${{ needs.prepare.outputs.version }}
@@ -156,6 +158,24 @@ jobs:
156158
echo "target_path=content/validators/docker-compose.yaml" >> $GITHUB_OUTPUT
157159
echo "filter_pattern=.*" >> $GITHUB_OUTPUT
158160
;;
161+
"docker_compose_monitoring")
162+
echo "title=Docker Compose File (Monitoring)" >> $GITHUB_OUTPUT
163+
echo "source_path=source-repo/release/docker-compose.yaml" >> $GITHUB_OUTPUT
164+
echo "target_path=content/validators/docker-compose-monitoring.yaml" >> $GITHUB_OUTPUT
165+
echo "filter_pattern=.*" >> $GITHUB_OUTPUT
166+
;;
167+
"alloy_config")
168+
echo "title=Alloy Config File" >> $GITHUB_OUTPUT
169+
echo "source_path=source-repo/release/alloy-config.river" >> $GITHUB_OUTPUT
170+
echo "target_path=content/validators/alloy-config.river" >> $GITHUB_OUTPUT
171+
echo "filter_pattern=.*" >> $GITHUB_OUTPUT
172+
;;
173+
"greybox_setup")
174+
echo "title=Greybox Setup Guide" >> $GITHUB_OUTPUT
175+
echo "source_path=source-repo/release/greybox-setup-guide.md" >> $GITHUB_OUTPUT
176+
echo "target_path=content/validators/greybox-setup-guide.md" >> $GITHUB_OUTPUT
177+
echo "filter_pattern=.*" >> $GITHUB_OUTPUT
178+
;;
159179
"api_gen")
160180
echo "title=API Gen Methods" >> $GITHUB_OUTPUT
161181
echo "source_path=source-repo/${{ github.event.inputs.api_gen_path || github.event.client_payload.api_gen_path || 'docs/api/rpc' }}" >> $GITHUB_OUTPUT
@@ -421,6 +441,9 @@ jobs:
421441
- \`npm run node-update-setup-guide\`
422442
- \`npm run node-update-config\`
423443
- \`npm run node-update-docker-compose\`
444+
- \`npm run node-update-monitoring-docker-compose\`
445+
- \`npm run node-update-monitoring-alloy-config\`
446+
- \`npm run node-update-greybox\`
424447
- \`npm run node-generate-api-docs\`
425448
426449
Please review the changes and merge if everything looks correct.
@@ -488,14 +511,17 @@ jobs:
488511
echo "" >> $GITHUB_STEP_SUMMARY
489512
490513
# Process each sync type report
491-
for sync_type in changelog config config_asimov config_bradbury docker_compose api_gen api_debug api_ops; do
514+
for sync_type in changelog config config_asimov config_bradbury docker_compose docker_compose_monitoring alloy_config greybox_setup api_gen api_debug api_ops; do
492515
# Get proper title
493516
case "$sync_type" in
494517
"changelog") title="📝 Changelog Sync" ;;
495518
"config") title="⚙️ Config File Sync" ;;
496519
"config_asimov") title="⚙️ Config File Sync (Asimov)" ;;
497520
"config_bradbury") title="⚙️ Config File Sync (Bradbury)" ;;
498521
"docker_compose") title="🐳 Docker Compose Sync" ;;
522+
"docker_compose_monitoring") title="🐳 Docker Compose Sync (Monitoring)" ;;
523+
"alloy_config") title="📊 Alloy Config Sync" ;;
524+
"greybox_setup") title="🔧 Greybox Setup Guide Sync" ;;
499525
"api_gen") title="🔧 API Gen Methods Sync" ;;
500526
"api_debug") title="🐛 API Debug Methods Sync" ;;
501527
"api_ops") title="📊 API Ops Methods Sync" ;;
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
// Grafana Alloy Configuration for GenLayer Node Telemetry
2+
// Handles both log collection and metrics forwarding
3+
4+
// ==========================================
5+
// Log Collection and Forwarding
6+
// ==========================================
7+
8+
// Discovery component to find log files using local.file_match
9+
// Supports different log file patterns:
10+
// - Single node: "/var/log/genlayer/node.log"
11+
// - Multi-node: "/var/log/genlayer/*/logs/node.log" (each node in subdirectory)
12+
// - Custom pattern via LOG_FILE_PATTERN env var
13+
local.file_match "genlayer_logs" {
14+
path_targets = [{
15+
__path__ = coalesce(sys.env("LOG_FILE_PATTERN"), "/var/log/genlayer/node*.log"),
16+
}]
17+
}
18+
19+
// Relabel to add metadata labels to log entries
20+
discovery.relabel "add_labels" {
21+
targets = local.file_match.genlayer_logs.targets
22+
23+
// Add instance label from environment variable
24+
rule {
25+
target_label = "instance"
26+
replacement = sys.env("NODE_ID")
27+
}
28+
29+
// Add validator_name label from environment variable
30+
rule {
31+
target_label = "validator_name"
32+
replacement = sys.env("VALIDATOR_NAME")
33+
}
34+
35+
// Add component label
36+
rule {
37+
target_label = "component"
38+
replacement = "alloy"
39+
}
40+
41+
// Add job label
42+
rule {
43+
target_label = "job"
44+
replacement = "genlayer-node"
45+
}
46+
}
47+
48+
// Source component to read log files
49+
loki.source.file "genlayer" {
50+
targets = discovery.relabel.add_labels.output
51+
forward_to = [loki.write.central.receiver]
52+
53+
// Tail from end to avoid ingesting entire log history on startup
54+
tail_from_end = true
55+
}
56+
57+
// Write logs to central Loki instance
58+
loki.write "central" {
59+
endpoint {
60+
url = sys.env("CENTRAL_LOKI_URL")
61+
62+
// HTTP Basic Authentication
63+
basic_auth {
64+
username = sys.env("CENTRAL_LOKI_USERNAME")
65+
password = sys.env("CENTRAL_LOKI_PASSWORD")
66+
}
67+
68+
// Enable retry with default exponential backoff
69+
// Note: Alloy's loki.write doesn't have a retry block; retries are handled automatically
70+
// with exponential backoff by default when the endpoint is unreachable
71+
72+
// Configurable batch settings for efficient log sending
73+
batch_size = coalesce(sys.env("LOKI_BATCH_SIZE"), "1MiB") // Maximum batch size before sending
74+
batch_wait = coalesce(sys.env("LOKI_BATCH_WAIT"), "60s") // Maximum wait time before sending partial batch
75+
}
76+
}
77+
78+
// ==========================================
79+
// Prometheus Metrics Collection and Forwarding
80+
// ==========================================
81+
82+
// Scrape metrics from GenLayer node(s)
83+
// Supports both single node and multi-node configurations
84+
//
85+
// Single Node Mode:
86+
// Set NODE_METRICS_ENDPOINT, NODE_ID, VALIDATOR_NAME
87+
//
88+
// Multi-Node Mode:
89+
// Set SCRAPE_TARGETS_JSON with JSON array of target objects
90+
// Example: [{"__address__":"host.docker.internal:9250","instance":"0x...","validator_name":"node-1"}]
91+
//
92+
// Note: The "network" label is emitted by the node itself (auto-detected from consensus address),
93+
// so it does not need to be configured here.
94+
prometheus.scrape "genlayer_node" {
95+
// Dynamic targets based on environment variable
96+
// If SCRAPE_TARGETS_JSON is set, use it (multi-node mode)
97+
// Otherwise, build single target from individual env vars (single node mode)
98+
targets = encoding.from_json(coalesce(sys.env("SCRAPE_TARGETS_JSON"), string.format("[{\"__address__\":\"%s\",\"instance\":\"%s\",\"validator_name\":\"%s\"}]", coalesce(sys.env("NODE_METRICS_ENDPOINT"), "host.docker.internal:9153"), coalesce(sys.env("NODE_ID"), "local"), coalesce(sys.env("VALIDATOR_NAME"), "default"))))
99+
100+
forward_to = [prometheus.relabel.metrics.receiver]
101+
102+
// Configurable scrape intervals
103+
scrape_interval = coalesce(sys.env("METRICS_SCRAPE_INTERVAL"), "60s")
104+
scrape_timeout = coalesce(sys.env("METRICS_SCRAPE_TIMEOUT"), "10s")
105+
}
106+
107+
// Relabel metrics to filter before forwarding
108+
prometheus.relabel "metrics" {
109+
forward_to = [prometheus.remote_write.central.receiver]
110+
111+
// Option 1: Forward all metrics (default)
112+
// Currently forwarding all metrics from the node.
113+
114+
// Option 2: Only keep genlayer_node_* metrics to reduce bandwidth (recommended)
115+
// To enable filtering and reduce bandwidth, uncomment the following rule:
116+
/*
117+
rule {
118+
source_labels = ["__name__"]
119+
regex = "genlayer_node_.*"
120+
action = "keep"
121+
}
122+
*/
123+
}
124+
125+
// Remote write configuration for sending metrics to central Prometheus
126+
prometheus.remote_write "central" {
127+
endpoint {
128+
url = sys.env("CENTRAL_MONITORING_URL")
129+
130+
// HTTP Basic Authentication
131+
basic_auth {
132+
username = sys.env("CENTRAL_MONITORING_USERNAME")
133+
password = sys.env("CENTRAL_MONITORING_PASSWORD")
134+
}
135+
136+
// Queue configuration for reliability
137+
queue_config {
138+
capacity = 10000
139+
max_shards = 5
140+
max_samples_per_send = 500
141+
batch_send_deadline = coalesce(sys.env("METRICS_BATCH_SEND_DEADLINE"), "60s")
142+
}
143+
}
144+
}
145+
146+
// ==========================================
147+
// Alloy Self-Monitoring
148+
// ==========================================
149+
150+
// Alloy internal exporter for health monitoring
151+
prometheus.exporter.self "alloy" {}
152+
153+
// Expose Alloy's own metrics on the HTTP server
154+
prometheus.scrape "alloy" {
155+
targets = prometheus.exporter.self.alloy.targets
156+
forward_to = [] // Not forwarding Alloy metrics to reduce noise
157+
158+
// Configurable scrape interval for Alloy's internal health monitoring
159+
scrape_interval = coalesce(sys.env("ALLOY_SELF_MONITORING_INTERVAL"), "60s")
160+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## v0.5.7
2+
3+
### New features
4+
5+
- Add LLM greyboxing with configurable chain order via YAML meta
6+
7+
### Bug fixes
8+
9+
- Use PendingAt for idle activator rotation
10+
- Remove unnecessary workaround from view calls
11+
- Restart sync pipeline after RPC failures
12+
- Suppress shutdown errors in watchers
13+
- Reduce FindAcceptanceBlock range to fit RPC limit
14+
15+
### Misc
16+
17+
- Include Alloy healthcheck script in release tarball
18+
- Increase Alloy push intervals to 60s

0 commit comments

Comments
 (0)