A sediment trap which is sometimes called a drip leg (although technically different) is a capped off section of gas line which is installed in such a way that any debris or moisture in the gas line will be caught in the trap where it can be cleaned out easily. The reason for this is to ensure safe operation of an appliance by keeping debris out of the tiny orifices of the gas valves. The moisture content of natural gas varies widely depending on geographic location but in those places where there is a higher moisture level in the gas, maintenance of these clean outs is essential.
So what is the technical difference between a drip leg and a sediment trap? A drip leg can be installed anywhere at the low point in the piping system if there is moisture in the gas to allow for the removal of the condensation. The outlet of the meter is one such location. A sediment trap usually is installed as close to the appliance as possible.
See the picture below.
2009, 2012 IRC G2419.4 (408.4) Sediment trap. Where a sediment trap is not incorporated as part of the appliance, a sediment trap shall be installed downstream of the appliance shutoff valve as close to the inlet of the appliance as practical. The sediment trap shall be either a tee fitting having a capped nipple of any length installed vertically in the bottom-most opening of the tee or other device approved as an effective sediment trap. Illuminating appliances, gas fireplaces, ranges, clothes dryers and outdoor grills need not be so equipped.
Here is a picture of a sediment trap on an air handler on a home under construction. Although the gas line appliance connector to the appliance is yet to be installed; you can see how the trap would work.
The most common deficiencies are the valve on the wrong side of the trap or they are missing altogether. Missing traps are common on older homes or do it yourself jobs.