Nest Redis Health Module
Redis(ioredis) health checks module for Nest framework (node.js).
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
About The Project¶
Features¶
- Both redis & cluster are supported.
- Health: Checks health of redis & cluster server.
- Rigorously tested: With 20+ tests and 100% code coverage.
Test coverage¶
Statements | Branches | Functions | Lines |
---|---|---|---|
Getting Started¶
Prerequisites¶
This lib requires Node.js >=12.22.0, NestJS ^9.0.0, ioredis ^5.0.0.
Installation¶
Usage¶
1, import TerminusModule
and RedisHealthModule
into the imports array:
2, let's setup AppController
:
3, if your redis server is reachable, you should now see the following JSON-result when requesting http://localhost:3000/health with a GET request:
INFO: Read more about
@nestjs/terminus
here.HINT: Both
TerminusModule
andRedisHealthModule
are not global modules.
Settings¶
Redis¶
Name | Type | Default | Required | Description |
---|---|---|---|---|
type | 'redis' |
undefined |
true |
Server type. You must specify what Redis server type you use. Possible values are "redis", "cluster". |
client | Redis |
undefined |
true |
The client which the health check should get executed. |
timeout | number |
1000 |
false |
The amount of time the check should require in ms . |
memoryThreshold | number |
undefined |
false |
The maximum amount of memory used by redis in bytes . |
Cluster¶
Name | Type | Default | Required | Description |
---|---|---|---|---|
type | 'cluster' |
undefined |
true |
Server type. You must specify what Redis server type you use. Possible values are "redis", "cluster". |
client | Cluster |
undefined |
true |
The client which the health check should get executed. |
License¶
Distributed under the MIT License. See LICENSE
for more information.