Narrative:

This seems to be a lesson I keep relearning through close calls; 'towers don't always alert you about traffic.' I had to fly through ZZZ class D airspace. Shortly after repeating the transition approval to tower; I 'relaxed' and started admiring the city below me and think about a recent competition while flying south bound. I was at least 4 miles east of the airport.aircraft Y landed [later on] but it was about to make the evening news few moments before that. I estimated that we were about 3 seconds from a midair collision. What woke me up from daydreaming was the tower calling aircraft Y about traffic at 1 o'clock while they are on the left downwind of xx. Tower was not talking to me but I had that feeling that he was talking about me in a very calm voice. I looked up and saw an airplane getting bigger in my windshield. I immediately replied to tower that traffic in sight and I'm descending. I must have dropped about 500 ft. Then I continued my boring flight afterwards.

Google
 

Original NASA ASRS Text

Title: C-150 Private Pilot reported executing a successful evasive maneuver due to an NMAC event.

Narrative: This seems to be a lesson I keep relearning through close calls; 'Towers don't always alert you about traffic.' I had to fly through ZZZ Class D airspace. Shortly after repeating the transition approval to Tower; I 'relaxed' and started admiring the city below me and think about a recent competition while flying south bound. I was at least 4 miles east of the airport.Aircraft Y landed [later on] but it was about to make the evening news few moments before that. I estimated that we were about 3 seconds from a midair collision. What woke me up from daydreaming was the Tower calling Aircraft Y about traffic at 1 o'clock while they are on the left downwind of XX. Tower was not talking to me but I had that feeling that he was talking about me in a very calm voice. I looked up and saw an airplane getting bigger in my windshield. I immediately replied to Tower that traffic in sight and I'm descending. I must have dropped about 500 ft. Then I continued my boring flight afterwards.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.