diff --git a/grandine-allin1.yml b/grandine-allin1.yml index a0beaab4..2291619c 100644 --- a/grandine-allin1.yml +++ b/grandine-allin1.yml @@ -50,6 +50,8 @@ services: - CL_P2P_PORT=${CL_P2P_PORT:-9000} - CL_QUIC_PORT=${CL_QUIC_PORT:-9001} - NETWORK=${NETWORK} + - COMPOSE_FILE=${COMPOSE_FILE} + - LOG_LEVEL=${LOG_LEVEL} - RUST_LOG=${LOG_LEVEL:-info} ports: - ${HOST_IP:-}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp diff --git a/grandine-cl-only.yml b/grandine-cl-only.yml index 892e17e5..494cb698 100644 --- a/grandine-cl-only.yml +++ b/grandine-cl-only.yml @@ -48,6 +48,9 @@ services: - CL_P2P_PORT=${CL_P2P_PORT:-9000} - CL_QUIC_PORT=${CL_QUIC_PORT:-9001} - NETWORK=${NETWORK} + - COMPOSE_FILE=${COMPOSE_FILE} + - LOG_LEVEL=${LOG_LEVEL} + - RUST_LOG=${LOG_LEVEL:-info} ports: - ${HOST_IP:-}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp - ${HOST_IP:-}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp diff --git a/grandine/docker-entrypoint.sh b/grandine/docker-entrypoint.sh index 5f3bc830..b8d311ca 100755 --- a/grandine/docker-entrypoint.sh +++ b/grandine/docker-entrypoint.sh @@ -186,15 +186,26 @@ else __w3s_url="" fi +# Traces +if [[ "${COMPOSE_FILE}" =~ (grafana\.yml|grafana-rootless\.yml) ]]; then + __trace="--telemetry-metrics-url http://tempo:4317 --telemetry-service-name grandine --telemetry-level ${LOG_LEVEL:-info}" +# These may become default in future. Here so Grandine doesn't murder itself in the meantime + export OTEL_TRACES_SAMPLER=parentbased_traceidratio + export OTEL_TRACES_SAMPLER_ARG=0.01 + export OTEL_EXPORTER_OTLP_INSECURE=true +else + __trace="" +fi + __strip_empty_args "$@" set -- "${__args[@]}" if [[ "${DEFAULT_GRAFFITI}" = "true" ]]; then # Word splitting is desired for the command line parameters # shellcheck disable=SC2086 - exec "$@" ${__network} ${__w3s_url} ${__mev_boost} ${__mev_factor} ${__checkpoint_sync} ${__prune} ${__beacon_stats} ${__ipv6} ${__doppel} ${CL_EXTRAS} ${VC_EXTRAS} + exec "$@" ${__network} ${__w3s_url} ${__mev_boost} ${__mev_factor} ${__checkpoint_sync} ${__prune} ${__beacon_stats} ${__ipv6} ${__doppel} ${__trace} ${CL_EXTRAS} ${VC_EXTRAS} else # Word splitting is desired for the command line parameters # shellcheck disable=SC2086 - exec "$@" ${__network} ${__w3s_url} ${__mev_boost} ${__mev_factor} ${__checkpoint_sync} ${__prune} ${__beacon_stats} ${__ipv6} ${__doppel} --graffiti "${GRAFFITI}" ${CL_EXTRAS} ${VC_EXTRAS} + exec "$@" ${__network} ${__w3s_url} ${__mev_boost} ${__mev_factor} ${__checkpoint_sync} ${__prune} ${__beacon_stats} ${__ipv6} ${__doppel} --graffiti "${GRAFFITI}" ${__trace} ${CL_EXTRAS} ${VC_EXTRAS} fi diff --git a/nethermind.yml b/nethermind.yml index 668b0e2b..7c372890 100644 --- a/nethermind.yml +++ b/nethermind.yml @@ -32,6 +32,7 @@ services: - NETWORK=${NETWORK} # For Grandine plugin - COMPOSE_FILE=${COMPOSE_FILE} + - LOG_LEVEL=${LOG_LEVEL} volumes: - nethermind-el-data:/var/lib/nethermind - nm-eth1-data:/var/lib/nethermind-og diff --git a/nethermind/docker-entrypoint.sh b/nethermind/docker-entrypoint.sh index daa4d52a..d95b912d 100755 --- a/nethermind/docker-entrypoint.sh +++ b/nethermind/docker-entrypoint.sh @@ -297,6 +297,15 @@ if [[ "${COMPOSE_FILE}" =~ grandine-plugin(-allin1)?\.yml ]]; then __grandine+=" --grandine-graffiti ${GRAFFITI}" fi +# Traces + if [[ "${COMPOSE_FILE}" =~ (grafana\.yml|grafana-rootless\.yml) ]]; then + __grandine+=" --grandine-telemetrymetricsurl http://tempo:4317 --grandine-telemetryservicename grandine --grandine-telemetrylevel ${LOG_LEVEL:-info}" + # These may become default in future. Here so Grandine doesn't murder itself in the meantime + export OTEL_TRACES_SAMPLER=parentbased_traceidratio + export OTEL_TRACES_SAMPLER_ARG=0.01 + export OTEL_EXPORTER_OTLP_INSECURE=true + fi + __grandine+=" ${CL_EXTRAS} ${VC_EXTRAS}" else __grandine=""