I'd do the second. The first has the problem that the labels change, creating a new metric each time - you'll have metrics appearing and disappearing as the states change.
The systemd module for the node exporter does this, similar to your second choice:
node_systemd_unit_state{name="nginx.service",state="activating",type="forking"} 0
node_systemd_unit_state{name="nginx.service",state="active",type="forking"} 1
node_systemd_unit_state{name="nginx.service",state="deactivating",type="forking"} 0
node_systemd_unit_state{name="nginx.service",state="failed",type="forking"} 0
node_systemd_unit_state{name="nginx.service",state="inactive",type="forking"} 0
There is a metric / label set for each state, and the values change from 0 to 1 and back as the service transitions through each state.
Counting systems in each state is just a sum by (name,state) (node_systemd_unit_state) operation. Displaying the current state in Grafana can be done with node_systemd_unit_state == 1 , and then using Grafana's ability to extract and display the value of the "state" label.
--
Harald