Skip to content

Commit af28d08

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

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/shared.bash

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,12 @@ function run_docker_compose() {
300300
export TRACEPARENT="$BUILDKITE_TRACING_TRACEPARENT"
301301
fi
302302

303+
# Set OTEL_SERVICE_NAME to match the agent's service name so docker-compose
304+
# spans appear under buildkite-agent service instead of separate "compose" service
305+
if [[ -z "${OTEL_SERVICE_NAME:-}" ]] && [[ -n "${BUILDKITE_TRACING_SERVICE_NAME:-}" ]]; then
306+
export OTEL_SERVICE_NAME="$BUILDKITE_TRACING_SERVICE_NAME"
307+
fi
308+
303309
if [[ "$disable_otel_config" == "true" ]]; then
304310
echo "~~~ :no_entry_sign: Disabling docker-compose OTEL traces"
305311

0 commit comments

Comments
 (0)