You can simply measure the depth of the hole, i.e. how much thickness to the backside. That's what they call the "grip length" of a rivet and that spec will be given on the rivet box for each size. The overall length of the rivet will be about 1/4" more than the grip length.
If you can't see the backside to tell how deep it is, take a piece of wire and bend a short "L" in one end. Slip it in the hole until it reaches the back side, then hook the "L" over the back and mark the wire at the front surface, e.g. a piece of tape or some paint. Then slide the wire back out and measure from the L to the mark and that's the required grip length.
2004 American Tradition; 2014 Buick LaCRosse
Homebase in the Ocala Nat'l Forest near Ocala, FL