Skip to content

Commit 3e4e8b7

Browse files
committed
Add tracing to clients
1 parent 14e0d00 commit 3e4e8b7

File tree

10 files changed

+48
-2
lines changed

10 files changed

+48
-2
lines changed

besu.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ services:
2828
- NODE_TYPE=${EL_NODE_TYPE:-pre-merge-expiry}
2929
- NETWORK=${NETWORK}
3030
- IPV6=${IPV6:-false}
31+
- COMPOSE_FILE=${COMPOSE_FILE}
3132
volumes:
3233
- besu-el-data:/var/lib/besu
3334
- besu-eth1-data:/var/lib/besu-og

besu/docker-entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ fi
123123
__strip_empty_args "$@"
124124
set -- "${__args[@]}"
125125

126+
# Traces
127+
if [[ "${COMPOSE_FILE}" =~ (grafana\.ymlr|grafana-rootless\.yml) ]]; then
128+
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
129+
export OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4317
130+
export OTEL_EXPORTER_OTLP_INSECURE=true
131+
export OTEL_SERVICE_NAME=besu
132+
fi
133+
126134
if [[ -f /var/lib/besu/prune-history-marker ]]; then
127135
rm -f /var/lib/besu/prune-history-marker
128136
if [[ "${NODE_TYPE}" = "archive" ]]; then

lighthouse-cl-only.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ services:
4141
- CL_P2P_PORT=${CL_P2P_PORT:-9000}
4242
- CL_QUIC_PORT=${CL_QUIC_PORT:-9001}
4343
- NETWORK=${NETWORK}
44+
- COMPOSE_FILE=${COMPOSE_FILE}
4445
ports:
4546
- ${HOST_IP:-}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
4647
- ${HOST_IP:-}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp

lighthouse.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ services:
5151
- CL_P2P_PORT=${CL_P2P_PORT:-9000}
5252
- CL_QUIC_PORT=${CL_QUIC_PORT:-9001}
5353
- NETWORK=${NETWORK}
54+
- COMPOSE_FILE=${COMPOSE_FILE}
5455
ports:
5556
- ${HOST_IP:-}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
5657
- ${HOST_IP:-}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp

lighthouse/docker-entrypoint.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ fi
116116
__strip_empty_args "$@"
117117
set -- "${__args[@]}"
118118

119+
# Traces
120+
if [[ "${COMPOSE_FILE}" =~ (grafana\.ymlr|grafana-rootless\.yml) ]]; then
121+
__trace="--telemetry-collector-url http://tempo:4317 --telemetry-service-name lighthouse"
122+
# These may become default in future. Here so Lighthouse doesn't murder itself in the meantime
123+
export OTEL_TRACES_SAMPLER=parentbased_traceidratio
124+
export OTEL_TRACES_SAMPLER_ARG=0.01
125+
export OTEL_EXPORTER_OTLP_INSECURE=true
126+
else
127+
__trace=""
128+
fi
129+
119130
if [[ -f /var/lib/lighthouse/beacon/prune-marker ]]; then
120131
rm -f /var/lib/lighthouse/beacon/prune-marker
121132
if [[ "${NODE_TYPE}" = "archive" ]]; then
@@ -128,5 +139,5 @@ if [[ -f /var/lib/lighthouse/beacon/prune-marker ]]; then
128139
else
129140
# Word splitting is desired for the command line parameters
130141
# shellcheck disable=SC2086
131-
exec "$@" ${__network} ${__mev_boost} ${__checkpoint_sync} ${__prune} ${__beacon_stats} ${__ipv6} ${CL_EXTRAS}
142+
exec "$@" ${__network} ${__mev_boost} ${__checkpoint_sync} ${__prune} ${__beacon_stats} ${__trace} ${__ipv6} ${CL_EXTRAS}
132143
fi

reth.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ services:
2929
- NODE_TYPE=${EL_NODE_TYPE:-pre-merge-expiry}
3030
- NETWORK=${NETWORK}
3131
- STATIC_DIR=${ANCIENT_DIR}
32+
- COMPOSE_FILE=${COMPOSE_FILE}
3233
# Make this RUST_LOG=${LOG_LEVEL:-info},engine=trace when requiring deep debug
3334
# RPC debug can be done with jsonrpsee=trace or jsonrpsee::target=trace for a specific target
3435
# - RUST_LOG=${LOG_LEVEL:-info},engine=trace

reth/docker-entrypoint.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ fi
139139
__strip_empty_args "$@"
140140
set -- "${__args[@]}"
141141

142+
# Traces
143+
if [[ "${COMPOSE_FILE}" =~ (grafana\.ymlr|grafana-rootless\.yml) ]]; then
144+
__trace="--tracing-otlp=http://tempo:4318/v1/traces"
145+
export OTEL_EXPORTER_OTLP_INSECURE=true
146+
export OTEL_SERVICE_NAME=reth
147+
else
148+
__trace=""
149+
fi
150+
142151
if [[ -f /var/lib/reth/prune-marker ]]; then
143152
rm -f /var/lib/reth/prune-marker
144153
if [[ "${NODE_TYPE}" = "archive" ]]; then
@@ -151,5 +160,5 @@ if [[ -f /var/lib/reth/prune-marker ]]; then
151160
else
152161
# Word splitting is desired for the command line parameters
153162
# shellcheck disable=SC2086
154-
exec "$@" ${__network} ${__verbosity} ${__static} ${__prune} ${EL_EXTRAS}
163+
exec "$@" ${__network} ${__verbosity} ${__static} ${__prune} ${__trace} ${EL_EXTRAS}
155164
fi

ssv.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ services:
2323
- CONFIG_PATH=/config/config.yaml
2424
- HOME=/tmp
2525
- ENABLE_DOPPELGANGER_PROTECTION=${DOPPELGANGER:-false}
26+
# This will throw errors if tempo is not running. An alternative would be an entrypoint script for ssv node
27+
- OTEL_EXPORTER_OTLP_PROTOCOL=grpc
28+
- OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4317
29+
- OTEL_EXPORTER_OTLP_INSECURE=true
30+
- OTEL_SERVICE_NAME=ssv-node
2631
command: make BUILD_PATH=/go/bin/ssvnode start-node
2732
labels:
2833
- metrics.scrape=true

vero-vc-only.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ services:
3636
- NETWORK=${NETWORK}
3737
- CL_NODE=${CL_NODE}
3838
- LOG_LEVEL=${LOG_LEVEL}
39+
- COMPOSE_FILE=${COMPOSE_FILE}
3940
volumes:
4041
- vero-data:/var/lib/vero
4142
- /etc/localtime:/etc/localtime:ro

vero/docker-entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ fi
100100
# Uppercase log level
101101
__log_level="--log-level ${LOG_LEVEL^^}"
102102

103+
# Traces
104+
if [[ "${COMPOSE_FILE}" =~ (grafana\.ymlr|grafana-rootless\.yml) ]]; then
105+
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
106+
export OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4317
107+
export OTEL_EXPORTER_OTLP_INSECURE=true
108+
export OTEL_SERVICE_NAME=vero
109+
fi
110+
103111
if [[ "${DEFAULT_GRAFFITI}" = "true" ]]; then
104112
# Word splitting is desired for the command line parameters
105113
# shellcheck disable=SC2086

0 commit comments

Comments
 (0)