Skip to main content

RedisInstrumentationHook

This class is a hook that adds metrics around Redis operations. It can be added to a Redis client to instrument its operations.

Methods


DialHook()

@classmethod
def DialHook(
next: redis.DialHook
) - > redis.DialHook

Returns a Redis DialHook that wraps the provided hook, adding metrics around the dial operation. This allows for instrumentation of the connection establishment phase.

Parameters

NameTypeDescription
nextredis.DialHookThe next Redis DialHook in the chain to be executed after instrumentation.

Returns

TypeDescription
redis.DialHookA new Redis DialHook instance that includes instrumentation.

ProcessHook()

@classmethod
def ProcessHook(
next: redis.ProcessHook
) - > redis.ProcessHook

Returns a Redis ProcessHook that wraps the provided hook, adding metrics around the command processing operation. This enables monitoring of individual Redis command executions.

Parameters

NameTypeDescription
nextredis.ProcessHookThe next Redis ProcessHook in the chain to be executed after instrumentation.

Returns

TypeDescription
redis.ProcessHookA new Redis ProcessHook instance that includes instrumentation.

ProcessPipelineHook()

@classmethod
def ProcessPipelineHook(
next: redis.ProcessPipelineHook
) - > redis.ProcessPipelineHook

Returns a Redis ProcessPipelineHook that wraps the provided hook, adding metrics around the pipeline processing operation. This allows for instrumentation of batched Redis command executions.

Parameters

NameTypeDescription
nextredis.ProcessPipelineHookThe next Redis ProcessPipelineHook in the chain to be executed after instrumentation.

Returns

TypeDescription
redis.ProcessPipelineHookA new Redis ProcessPipelineHook instance that includes instrumentation.