Skip to main content

RedisInstrumentationHook

A hook that adds metrics around redis operations.

Methods


DialHook()

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

Returns a Redis DialHook that wraps the provided hook, adding metrics around the Redis 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 Redis command processing operation. This enables monitoring of individual command execution times and outcomes.

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 Redis pipeline processing operation. This allows for instrumentation of batched command execution.

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.