The answer depends on what aspect of the pencil you wish to measure: its length, diameter, mass or something else.
Any metric unit would do. But it might be easier to pick something smaller than the length of the pencil, like a centimeter, or a millimeter.
An average pencil when new would be around 15 centimetres long.
I would use a centimetre.
Centimeters/inchesThe most appropriate metric unit for the purpose of measuring the length of a pencil would be centimetres.