Add connection stats to prometheus stats
Created by: dagurval
Adds the following new prometheus counters:
-
electrscash_rpc_connections
: Number of current connections. -
electrscash_rpc_connections_total
: Connections since server was started. -
electrscash_rpc_connections_rejected_global
: Connections rejected due to global limits -
electrscash_rpc_connections_rejected_prefix
: Connections rejected due to IP prefix
Test plan
Run ./contrib/client.py --server localhost server.ping
. Observe that total counter increases. Add time.sleep(100)
to client. Observe that `current connection counter is correct.