mirror of
https://github.com/LBRYFoundation/lbry-sdk.git
synced 2025-08-23 17:27:25 +00:00
add reset clients counter to prometheus
This commit is contained in:
parent
d17f0cfa40
commit
5b29894048
2 changed files with 7 additions and 2 deletions
|
@ -39,8 +39,7 @@ from lbry.wallet.tasks import TaskGroup
|
||||||
from .jsonrpc import Request, JSONRPCConnection, JSONRPCv2, JSONRPC, Batch, Notification
|
from .jsonrpc import Request, JSONRPCConnection, JSONRPCv2, JSONRPC, Batch, Notification
|
||||||
from .jsonrpc import RPCError, ProtocolError
|
from .jsonrpc import RPCError, ProtocolError
|
||||||
from .framing import BadMagicError, BadChecksumError, OversizedPayloadError, BitcoinFramer, NewlineFramer
|
from .framing import BadMagicError, BadChecksumError, OversizedPayloadError, BitcoinFramer, NewlineFramer
|
||||||
from .util import Concurrency
|
from lbry.wallet.server.prometheus import NOTIFICATION_COUNT, RESPONSE_TIMES, REQUEST_ERRORS_COUNT, RESET_CONNECTIONS
|
||||||
from lbry.wallet.server.prometheus import NOTIFICATION_COUNT, RESPONSE_TIMES, REQUEST_ERRORS_COUNT
|
|
||||||
|
|
||||||
|
|
||||||
class Connector:
|
class Connector:
|
||||||
|
@ -389,6 +388,7 @@ class RPCSession(SessionBase):
|
||||||
except MemoryError:
|
except MemoryError:
|
||||||
self.logger.warning('received oversized message from %s:%s, dropping connection',
|
self.logger.warning('received oversized message from %s:%s, dropping connection',
|
||||||
self._address[0], self._address[1])
|
self._address[0], self._address[1])
|
||||||
|
RESET_CONNECTIONS.labels(version=self.client_version).inc()
|
||||||
self._close()
|
self._close()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,11 @@ BLOCK_UPDATE_TIMES = Histogram("block_time", "Block update times", namespace=NAM
|
||||||
REORG_COUNT = Gauge(
|
REORG_COUNT = Gauge(
|
||||||
"reorg_count", "Number of reorgs", namespace=NAMESPACE
|
"reorg_count", "Number of reorgs", namespace=NAMESPACE
|
||||||
)
|
)
|
||||||
|
RESET_CONNECTIONS = Counter(
|
||||||
|
"reset_clients", "Number of reset connections by client version",
|
||||||
|
namespace=NAMESPACE, labelnames=("version",)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class PrometheusServer:
|
class PrometheusServer:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue