It's important to remember that these pipelines don't exist as a single isolated line and will have a number of branches that tie into the main pipeline and split off for gas to be sold to different locations. This touches on a very broad subject of flow assurance and pipeline network modeling.
The pipeline will also be broken into smaller sections by compressor stations because, as you mentioned, friction losses will require the gas to be re-compressed as it travels along the pipeline.
To answer your question, the gas flow rate will be regularly measured using a variety of flow meters such as an orifice meter, ultrasonic meter, Coriolis meter, turbine meter etc. This will occur at any point were gas flows into the main pipeline or is branched off the be sold. It also may occur at regular intervals (i.e. the compressor stations) along the pipeline. If you want to determine the mach number you could simply calculate it from your measured velocity.
I am not aware of any target mach number or velocity in pipelines, it will certainly be subsonic, the rest will depend on the specifics of the section of pipe. For example, the elevation profile, the presence of liquids, corrosion, and the required pressure at the destination all will have an effect on the velocity you can transport the gas.