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
| Name | Type | Description |
|---|---|---|
| next | redis.DialHook | The next Redis DialHook in the chain to be executed after instrumentation. |
Returns
| Type | Description |
|---|---|
redis.DialHook | A 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
| Name | Type | Description |
|---|---|---|
| next | redis.ProcessHook | The next Redis ProcessHook in the chain to be executed after instrumentation. |
Returns
| Type | Description |
|---|---|
redis.ProcessHook | A 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
| Name | Type | Description |
|---|---|---|
| next | redis.ProcessPipelineHook | The next Redis ProcessPipelineHook in the chain to be executed after instrumentation. |
Returns
| Type | Description |
|---|---|
redis.ProcessPipelineHook | A new Redis ProcessPipelineHook instance that includes instrumentation. |