diff --git a/pkg/fleet/installer/setup/djm/emr.go b/pkg/fleet/installer/setup/djm/emr.go index bfbc2ebab2d16..c8003f4d70866 100644 --- a/pkg/fleet/installer/setup/djm/emr.go +++ b/pkg/fleet/installer/setup/djm/emr.go @@ -162,7 +162,7 @@ func setupEmrResourceManager(s *common.Setup, clusterName string) { } var executeCommandWithTimeout = func(s *common.Setup, command string, args ...string) (output []byte, err error) { - span, ctx := telemetry.StartSpanFromContext(s.Ctx, "setup.command") + span, _ := telemetry.StartSpanFromContext(s.Ctx, "setup.command") span.SetResourceName(command) defer func() { span.Finish(err) }() diff --git a/pkg/fleet/installer/setup/djm/emr_test.go b/pkg/fleet/installer/setup/djm/emr_test.go index 3bcf6e90be2b8..f5931399475fc 100644 --- a/pkg/fleet/installer/setup/djm/emr_test.go +++ b/pkg/fleet/installer/setup/djm/emr_test.go @@ -36,7 +36,10 @@ func TestSetupEmr(t *testing.T) { originalExecuteCommand := executeCommandWithTimeout defer func() { executeCommandWithTimeout = originalExecuteCommand }() // Restore original after test - executeCommandWithTimeout = func(s *common.Setup, command string, args ...string) ([]byte, error) { + executeCommandWithTimeout = func(s *common.Setup, command string, args ...string) (output []byte, err error) { + span, _ := telemetry.StartSpanFromContext(s.Ctx, "setup.command") + span.SetResourceName(command) + defer func() { span.Finish(err) }() if command == "aws" && args[0] == "emr" && args[1] == "describe-cluster" { return []byte(emrDescribeClusterResponse), nil }