MCPcopy
hub / github.com/redis/redis-py / record_error_count

Function record_error_count

redis/asyncio/observability/recorder.py:381–417  ·  view source on GitHub ↗

Record error count. Args: server_address: Server address server_port: Server port network_peer_address: Network peer address network_peer_port: Network peer port error_type: Error type (Exception) retry_attempts: Retry attempts is_int

(
    server_address: str,
    server_port: int,
    network_peer_address: str,
    network_peer_port: int,
    error_type: Exception,
    retry_attempts: int,
    is_internal: bool = True,
)

Source from the content-addressed store, hash-verified

379
380
381async def record_error_count(
382 server_address: str,
383 server_port: int,
384 network_peer_address: str,
385 network_peer_port: int,
386 error_type: Exception,
387 retry_attempts: int,
388 is_internal: bool = True,
389) -> None:
390 """
391 Record error count.
392
393 Args:
394 server_address: Server address
395 server_port: Server port
396 network_peer_address: Network peer address
397 network_peer_port: Network peer port
398 error_type: Error type (Exception)
399 retry_attempts: Retry attempts
400 is_internal: Whether the error is internal (e.g., timeout, network error)
401 """
402 collector = _get_or_create_collector()
403 if collector is None:
404 return
405
406 try:
407 collector.record_error_count(
408 server_address=server_address,
409 server_port=server_port,
410 network_peer_address=network_peer_address,
411 network_peer_port=network_peer_port,
412 error_type=error_type,
413 retry_attempts=retry_attempts,
414 is_internal=is_internal,
415 )
416 except Exception:
417 pass
418
419
420async def record_pubsub_message(

Callers 8

execute_commandMethod · 0.90
_executeMethod · 0.90
executeMethod · 0.90
connect_check_healthMethod · 0.90
disconnectMethod · 0.90
_record_error_metricMethod · 0.90

Calls 2

record_error_countMethod · 0.80
_get_or_create_collectorFunction · 0.70

Tested by

no test coverage detected