Skip to content

Commit 8aca4df

Browse files
committed
Add ditributed tracing to walshadow
1 parent 1746361 commit 8aca4df

25 files changed

Lines changed: 1809 additions & 845 deletions

‎Cargo.lock‎

Lines changed: 212 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ toml = { version = "1", default-features = false, features = ["parse", "serde"]
6262
tracing = "0.1"
6363
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt", "ansi"] }
6464
zstd = "0.13"
65+
opentelemetry = "0.32"
66+
opentelemetry_sdk = { version = "0.32", features = ["rt-tokio"] }
67+
opentelemetry-otlp = { version = "0.32", default-features = false, features = ["grpc-tonic", "trace"] }
68+
tracing-opentelemetry = { version = "0.33", default-features = false }
6569

6670
[dev-dependencies]
6771
tempfile = "3"

‎bench/ec2/ec2-walshadow/deploy.sh‎

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ source ./state.env # PUBLIC_IP, KEY_NAME, ...
2121
source ../lib.sh
2222

2323
IMAGE="${IMAGE:-walshadow:local}"
24-
FLUSH_TIMEOUT_MS="${FLUSH_TIMEOUT_MS:-50}"
24+
FLUSH_TIMEOUT_MS="${FLUSH_TIMEOUT_MS:-1000}"
2525
node_ssh_setup
2626

2727
SRC_PRIV="${SOURCE_PRIVATE_IP:-$(read_state_var ../ec2-source-pg/state.env SOURCE_PRIVATE_IP)}"
@@ -74,6 +74,39 @@ EOF
7474
-p 9484:9484 \
7575
$IMAGE >/dev/null && echo started"
7676

77+
# Rejoin the obs network (if it exists) so Prometheus keeps scraping by name.
78+
"${SSH[@]}" "sudo docker network connect walshadow-net walshadow 2>/dev/null || true"
79+
80+
# Grafana + Prometheus: only uploaded/recreated when FORCE_METRICS=1.
81+
if [ "${FORCE_METRICS:-0}" = "1" ]; then
82+
GRAFANA_IMAGE="${GRAFANA_IMAGE:-grafana/grafana:13.0.2}"
83+
PROM_IMAGE="${PROM_IMAGE:-prom/prometheus:v3.12.0}"
84+
REPO_ROOT="$(cd ../../.. && pwd)"
85+
86+
"${SSH[@]}" "sudo docker network inspect walshadow-net >/dev/null 2>&1 || sudo docker network create walshadow-net"
87+
"${SSH[@]}" "sudo docker network connect walshadow-net walshadow 2>/dev/null || true"
88+
89+
tar -C "$REPO_ROOT/docker" -czf - grafana prometheus \
90+
| "${SSH[@]}" "sudo install -d /opt/walshadow/obs && sudo tar -C /opt/walshadow/obs -xzf -"
91+
# compose hostname 'clickhouse' -> private IP
92+
"${SSH[@]}" "sudo grep -rl clickhouse /opt/walshadow/obs 2>/dev/null | sudo xargs -r sed -i 's/clickhouse:/$CH_PRIV:/g; s#//clickhouse#//$CH_PRIV#g'"
93+
94+
"${SSH[@]}" "sudo docker rm -f prometheus >/dev/null 2>&1 || true; sudo docker run -d --name prometheus --restart unless-stopped \
95+
--network walshadow-net \
96+
-v /opt/walshadow/obs/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro \
97+
-p 9090:9090 \
98+
$PROM_IMAGE >/dev/null && echo 'prometheus started'"
99+
100+
"${SSH[@]}" "sudo docker rm -f grafana >/dev/null 2>&1 || true; sudo docker run -d --name grafana --restart unless-stopped \
101+
--network walshadow-net \
102+
-e GF_AUTH_ANONYMOUS_ENABLED=true -e GF_AUTH_ANONYMOUS_ORG_ROLE=Admin \
103+
-e GF_INSTALL_PLUGINS=grafana-clickhouse-datasource \
104+
-v /opt/walshadow/obs/grafana/provisioning:/etc/grafana/provisioning:ro \
105+
-v /opt/walshadow/obs/grafana/dashboards:/var/lib/grafana/dashboards:ro \
106+
-p 3000:3000 \
107+
$GRAFANA_IMAGE >/dev/null && echo 'grafana started'"
108+
fi
109+
77110
echo
78111
echo "=== deployed ==="
79112
echo "metrics: curl http://$PUBLIC_IP:9484/metrics"

‎bench/ec2/ec2-walshadow/node.env‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Config for the walshadow daemon host. SSH + Prometheus metrics (:9484) from
2-
# the operator only; it emits into ClickHouse OUTBOUND over the VPC.
1+
# Config for the walshadow daemon host. SSH + walshadow /metrics (:9484) +
2+
# the co-located observability UIs — Grafana (:3000), Prometheus (:9090) —
3+
# all from the operator only; it emits into ClickHouse OUTBOUND over the VPC.
34
NODE_NAME=walshadow-daemon
4-
SG_DESC="walshadow daemon: SSH + Prometheus metrics from my IP"
5-
INGRESS="22:my 9484:my"
5+
SG_DESC="walshadow daemon: SSH + metrics + grafana/prometheus from my IP"
6+
INGRESS="22:my 9484:my 3000:my 9090:my"
67
NODE_NEXT="next: ./deploy.sh ships the image + config and starts the daemon"

0 commit comments

Comments
 (0)