@reqray/instrumentation-ioredis 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,12 +1,55 @@
|
|
|
1
1
|
# @reqray/instrumentation-ioredis
|
|
2
2
|
|
|
3
|
-
ioredis
|
|
3
|
+
Records every Redis command made through `ioredis` into the request that issued it: standalone and cluster clients, pipelines included.
|
|
4
4
|
|
|
5
|
-
Part of [Reqray](https://github.com/reqray/reqray) — a dev panel and request
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Part of [Reqray](https://github.com/reqray/reqray) — a dev panel and request inspector for Node.js. It
|
|
6
|
+
instruments HTTP, SQL, outgoing calls and cache on its own, shows every
|
|
7
|
+
request as a waterfall, and finds N+1 down to the file and the line.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## You probably do not need to install this
|
|
10
|
+
|
|
11
|
+
[`@reqray/register`](https://www.npmjs.com/package/@reqray/register) depends on
|
|
12
|
+
it and applies it automatically:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
node --import @reqray/register app.js
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
reqray instrumentation active
|
|
20
|
+
✔ ioredis@5.11.1 cache
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## What is recorded
|
|
24
|
+
|
|
25
|
+
For each command: its name, the key, whether a read was a hit or a miss, and the duration. That is what lets Reqray flag the same key being read twice in one request.
|
|
26
|
+
|
|
27
|
+
**Values are never recorded**, and there is no opt-in: `SET session:9 <jwt>` is stored as `SET session:9`. A command Reqray does not recognise — a custom one, `AUTH` — records its name and nothing else.
|
|
28
|
+
|
|
29
|
+
Supported: `ioredis` 5.x. Outside that range nothing is patched, and the startup
|
|
30
|
+
report says so.
|
|
31
|
+
|
|
32
|
+
## Applying it by hand
|
|
33
|
+
|
|
34
|
+
In a bundled application (esbuild, webpack, tsup) imports are resolved at build
|
|
35
|
+
time and loader hooks never fire. Apply the instrumentation yourself, before
|
|
36
|
+
the first call:
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
import Redis from 'ioredis';
|
|
40
|
+
import { instrumentIoredis } from '@reqray/instrumentation-ioredis';
|
|
41
|
+
|
|
42
|
+
instrumentIoredis().apply(Redis);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
No version range is checked on this path — the choice was yours.
|
|
46
|
+
|
|
47
|
+
The `redis` package (node-redis) is a different client and is not covered.
|
|
48
|
+
|
|
49
|
+
## More
|
|
50
|
+
|
|
51
|
+
Everything else — the detectors, security defaults, measured overhead and a
|
|
52
|
+
demo that runs with one command — is in the
|
|
10
53
|
[main README](https://github.com/reqray/reqray#readme).
|
|
11
54
|
|
|
12
55
|
## License
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reqray/instrumentation-ioredis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "ioredis driver instrumentation for Reqray.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@reqray/core": "^0.1.
|
|
51
|
+
"@reqray/core": "^0.1.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"ioredis": ">=5 <6"
|