I had to learn about that type earlier this winter. I have a overhead gas heater in my work shop, one that is called a infrared heater. It has one of the type of igniters you show. The valve or igniter it's self may not be the problem. Try cleaning the one electrode shown called the, "pin of the sensor" in your first picture. The igniter/sensor uses the pins to both ignite and sense flame, through a process called, "flame rectification". After the sparking to start the flame there is still a voltage on the one "Lighter pin", the other one is a ground for the spark. This continuous voltage is then rectified to keep the gas valve on. If there is any rust, corrosion or carbon build up on the sensor pin it won't work, so before doing any thing else clean the sensor pin with steel wool or a Scotchbite type abrasive pad. That worked for my heater, it is old and new parts aren't available for it so had to learn about them.