You sense the presence of any trap within range that is within line of sight. A trap, for the purpose of this spell, includes anything that would inflict a sudden or unexpected effect you consider harmful or undesirable, which was specifically intended as such by its creator. Thus, the spell would sense an area affected by the alarm spell, a glyph of warding, or a mechanical pit trap, but it would not reveal a natural weakness in the floor, an unstable ceiling, or a hidden sinkhole.
This spell merely reveals that a trap is present. You don't learn the location of each trap, but you do learn the general nature of the danger posed by a trap you sense.
The 2024 Player’s Handbook revised many spells, and the SRD 5.2 carries the new text. What changed from the 2014 version above:
Same level, casting time, range, components, duration and dice; the text is reworded for the 2024 rules glossary.
Casting time
Action
Range
120 feet
Components
V, S
Duration
Instantaneous
School
Divination
Level
2
Classes
Cleric, Druid, Ranger
You sense any trap within range that is within line of sight. A trap, for the purpose of this spell, includes any object or mechanism that was created to cause damage or other danger. Thus, the spell would sense the Alarm or Glyph of Warding spell or a mechanical pit trap, but it wouldn't reveal a natural weakness in the floor, an unstable ceiling, or a hidden sinkhole.
This spell reveals that a trap is present but not its location. You do learn the general nature of the danger posed by a trap you sense.
2024 version from the SRD 5.2. Most tables settle on one edition, so check which one yours uses.