client/finality-grandpa: Add Prometheus metrics to GossipValidator (#5237)

* client/finality-grandpa: Add Prometheus metrics to GossipValidator

Instrument finality grandpa `GossipValidator` exposing count of messages
validated by message type and message action.

```
\# HELP substrate_finality_grandpa_communication_gossip_validator_messages Number of messages validated by the finality grandpa gossip validator.
\# TYPE substrate_finality_grandpa_communication_gossip_validator_messages counter
substrate_finality_grandpa_communication_gossip_validator_messages{action="discard",message="neighbor"} 39
substrate_finality_grandpa_communication_gossip_validator_messages{action="keep",message="vote"} 28
```

* client/finality-grandpa: Add None as Prometheus registry in tests

* client/finality-granpda/src/communication: Refactor metric registration
This commit is contained in:
Max Inden
2020-03-14 12:51:44 +01:00
committed by GitHub
parent b817763ea9
commit 79fc16e4d7
6 changed files with 86 additions and 7 deletions
@@ -591,6 +591,7 @@ pub fn run_grandpa_voter<Block: BlockT, BE: 'static, C, N, SC, VR>(
network,
config.clone(),
persistent_data.set_state.clone(),
prometheus_registry.as_ref(),
);
register_finality_tracker_inherent_data_provider(client.clone(), &inherent_data_providers)?;