Skip to content

Commit db4c32e

Browse files
committed
Update shared.bash
1 parent e074cf0 commit db4c32e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

lib/shared.bash

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,19 @@ function run_docker_compose() {
302302

303303
if [[ "$disable_otel_config" == "true" ]]; then
304304
echo "~~~ :no_entry_sign: Disabling docker-compose OTEL traces"
305-
echo "DEBUG: TRACEPARENT: ${TRACEPARENT:-NOT SET}"
306-
echo "DEBUG: OTEL_EXPORTER_OTLP_HEADERS: ${OTEL_EXPORTER_OTLP_HEADERS:-NOT SET}"
307-
echo "DEBUG: OTEL_EXPORTER_OTLP_PROTOCOL: ${OTEL_EXPORTER_OTLP_PROTOCOL:-NOT SET}"
308305

306+
# Disable OTEL for docker-compose process by unsetting all OTEL variables
307+
# We save them first so they can still be passed to containers via -e flags
309308
(
309+
# Unset OTEL variables to prevent docker-compose from creating traces
310+
unset TRACEPARENT
311+
unset TRACESTATE
312+
unset OTEL_EXPORTER_OTLP_ENDPOINT
313+
unset OTEL_EXPORTER_OTLP_HEADERS
314+
unset OTEL_EXPORTER_OTLP_PROTOCOL
315+
unset OTEL_SERVICE_NAME
310316
export COMPOSE_EXPERIMENTAL_OTEL=0
317+
311318
plugin_prompt_and_run "${command[@]}" "$@"
312319
)
313320
else

0 commit comments

Comments
 (0)