The fact that you smell it, means it is already volatilising out of the water when you open the tap, so whatever sample you take of the water will underestimate the hydrocarbon contents.
You should also consider the fact that it's not coming from the water. Possible that it's coming from the outside, and it just happens to occur (or you notice it) when you open the tap.
Lastly, if the pH is off in the water, too acidic or too base then this can also eat away at your pipes. Typically though, many water quality smell and plumbing issues come from bacterial issues. Check this first and then move on if negative.