The top of a heater is where water enters, exits and relieves. Three different faults present there, and they are told apart by timing.
If it followed a cold night
A nipple or connector held water, froze, and split. Water then runs down the tank and appears at the base, which is why this gets misread as a tank failure.
The tell: it started with the weather, it may pause while everything is frozen, and it returns on thaw.
If it appears only during heating
Expansion. Water grows as it warms and pressure finds a joint. A failed expansion vessel is the usual cause, and the relief valve often weeps at the same time.
If the flue collar is wet (gas)
That is condensation or drafting, not a plumbing leak. It is a combustion-safety matter and should not be treated with a spanner.
Confirming it
Isolate, dry everything, then run a heating cycle and watch. A pressure-dependent leak will not show on a cold test.
Repair
Replace the failed component, refit with a fresh seal, then prove it under heat. If the same fitting has failed twice, the exposure is the real fault — insulate the run, keep it inside the warmed envelope where possible, and eliminate short dead legs.
What to have ready
Where the water shows, whether it followed a freeze, whether it is cycle-dependent.