Metal spikes on the wring of an air craft. What are they for?

Not sure if you're referring to pitot tubes or static wicks.

Generally speaking pitot tubes collect air for air speed calculations, while static wicks help discharge the static electricity that builds up from the air moving around the aircraft.