possibly it is mucus in stool or small amount of stools seeping from anus.
Need to stop tramadol
if possible and take some laxative available over the counter like cremaffin
15 ml thrices till you pass stools and then can reduce doses.
If you feel stool is impacted inside need to see a gastroenterologist.
Wish you a speedy recovery.