I dont know a lot about detecting gas leaks, but I have heard of infrared detectors, sniffers, ionisation techniques. Its not difficult. Google equipped some of their Streetview vehicles in Boston and 14 other cities with sniffers of some kind a couple of years ago and came up with some astounding results. Something like 1 to 2 leaks per mile of gas distribution pipelines were found A major replacement program was begun shortly thereafter. Boston is not the only city affected. The problem is that the distribution companies were not taking it seriously, since the customer pays for losses, and they were prescribing ridiculously low budgets and using schedules extending 20yrs to "fix" that issue.
The data for all cities can be downloaded.
Birmingham, Boston, Burlington, Chicago, ConEd New York, Dallas, Indianapolis, Jacksonville,
Los Angeles, Mesa data, PSE&G New Jersey, Pittsburgh, Staten Island, Syracuse.
Simulation software is also used to model ideal flows and check against real-time SCADA input variables for evidence of leaks when pressures and flows between the two dont add up. They also keep a check on running totals at purchase and sales meters where even very small discrepancies can be detected oner many months.
As far as larger transmission pipelines, blowing down gas to atmosphere is the last thing that they want to do. Generally the line pressure is reduced to as low a pressure as possible through normal means during periods of low demand to make repairs. Any gas that can be evacuated by other means, usually portable compressors, are employed. Only the minimum amount of gas necessary is ultimately vented and displaced by N2, if needed. The vast majority of their gas losses are through antiquated equipment, valve packing, pneumatic control valves and the like. Most companies have been replacing as much of that as they could since the early 90s with electric operators when possible. Occasionally operational overpressure will trigger a blowdown vent, but that is not often and it is a hugh problem for the section manager to justify the lost gas to the VPOps. Losses must be explained in detail to the FEDs as well.
During the last four years, increases in gas field flaring were allowed, but I think that Presidential Order was rescinded on day #2, Jan 22. I think some fields are still doing this, but are attempting to comply ASAP.