We can get this equation two ways:
We can build a "v notch' weir at the site and measure water level upstream of it. The geometry of the weir defines the mathematical relationship. The weir is usually made from concrete and so the equation stays accurate for the life of the weir.
We can choose a stable site and carry out a gauging to establish the relationship between water level and flow rate. The relationship may need to be re-established regularly, but this depends on the stability of the channel cross section.
NIWA's standard method is to measure water level using a stilling well and water level encoder connected to a recording device