Jon most certainly told them what happened if they hadn't worked it out themselves but I think it's pretty self explanatory. Jon is, like Ned, "an honourable fool" and so would think it is the right thing to tell people, he doesn't lie. Dany even chastises him for something similar in Season 7 Episode 7, "The Dragon and the Wolf", for not lying to Cersei to get her help. He was brought up not to weasel out of things like this but that aside he is in a fragile enough state that I doubt he'd have been able to lie even if he wanted to.
Jon goes into the Throne Room with Longclaw and a dagger where only him and Dany are in there. A while later Drogon gets really angry, melts the Iron Throne and the back wall of the Throne Room. This would undoubtedly attract Unsullied attention who would rush in to see if their queen is in danger.
They'd come in seeing Drogon flying off and might be able to see Dany's body in his claws. If not they see Jon upset, covered in blood and missing his dagger. They then see a blood patch on the floor near where Jon was standing and most importantly can't see Dany.
It's not much of a stretch to work out from there that Jon did it. There was no one else around who could have done it.