Was this a near collision or a normal procedure?
There is only 1000 ft of separation between levels of traffic at the altitudes jets operate in (above 29000 ft) and when you see someone 1000 ft above or below it looks really close.  When you are sitting in the flight deck the first time on a busy airway and oncoming traffic passes above or below, you think they are passing only a few hundred feet away even though they are 1000 ft.  When you first notice an oncoming contrail, it looks like it's coming straight at you until it's a mile or two away.

The Traffic Collision and Avoidance System (TCAS) on each airplane tells the crew the proximity and relative altitude of nearby traffic and the system gives warnings with directions to climb or descend if someone is on a collision path. Plus ATC knows everybody's altitude and the ATC computers provide warnings to controllers if an airplane deviates from an assigned altitude by more than a couple hundred feet.

It takes a lot to go wrong for airplanes to come too close to each other, although nothing is perfect and it can still happen.  The systems in place keep the probability to an acceptably low level.