Watchlog DocsWatchlog Docs
Home
Get Started
Gen AI Monitoring
Integrations
Log Watchlist
Home
Get Started
Gen AI Monitoring
Integrations
Log Watchlist
  • All Integrations
  • NGINX

    • Nginx Integration
    • Connect NGINX to Watchlog
    • Docker
    • Windows
    • Kubernetes
    • Source Code
  • IIS

    • IIS Integration
    • Ubuntu
    • Docker Container
    • Windows
    • Kubernetes
    • Source Code
  • REDIS

    • Redis Integration
    • Ubuntu
    • Docker Container
    • Windows
    • Kubernetes
    • Source Code
  • POSTGRESQL

    • PostgreSQL Integration
    • Ubuntu
    • Docker Container
    • Windows
    • Kubernetes
    • Source Code
  • MONGODB

    • MongoDB Integration
    • Ubuntu
    • Docker Container
    • Windows
    • Kubernetes
    • Source Code
  • MYSQL

    • MySQL Integration
    • Ubuntu
    • Docker Container
    • Windows
    • Kubernetes
    • Source Code
  • PM2

    • PM2 Integration
    • Ubuntu
    • Docker Container
    • Windows
    • Kubernetes
    • Source Code
  • DOCKER

    • Docker Integration
    • Ubuntu
    • Docker Container
    • Windows
    • Kubernetes
    • Source Code
  • GITLAB

    • Gitlab Integration
    • Ubuntu
    • Docker
    • Windows
    • Kubernetes
    • Source
  • ELASTICSEARCH

    • Elasticsearch Integration
    • Ubuntu
    • Docker Container
    • Windows
    • Kubernetes
    • Source Code

Source Code

  1. Go to your cloned repo:
    cd /path/to/watchlog-agent
    vim integration.json
    
  2. Locate the Redis config:

{ "service": "redis", "monitor": false, "host": "127.0.0.1", "port": "6379", "username": "", "password": "", "tls": false }

3. Set `"monitor"` to `true` and update the credentials:
```diff
-  "monitor": false
+  "monitor": true

Redis 6+ with an ACL user takes both username and password; a requirepass-only server takes password alone. 4. Restart the agent:

pm2 restart watchlog-agent

Prerequisite

redis-cli 6.2+ must be on PATH — that is when --json arrived, and the parsers depend on it. The agent probes for it and fails with a clear message rather than collecting nothing.

redis-cli --version

Run the collector directly

node -e "
const list = require('./integration.json');
const cfg = list.find(i => i.service === 'redis');
require('./app/integrations/redis/index').collect(cfg, (err, res) => {
  if (err) return console.error('failed:', err.message);
  const a = res.advanced;
  console.log('version   :', a.server.version, '| mode:', a.server.mode, '| role:', a.server.role);
  console.log('memory    :', a.memory.usedMemory, 'limit configured:', a.memory.memoryLimitConfigured);
  console.log('commands  :', (a.commands || []).length);
  console.log('slowlog   :', (a.slowlog || []).length);
  console.log('keyspace  :', (a.keyspace || []).length);
});
"

Running the tests

The Redis parsers and the argument sanitizer are covered by the agent's test suite, which needs no live server:

npm test

The sanitizer tests are the important ones — they assert what must not come out, so a failure there is a data leak rather than a cosmetic bug.

Development notes

  • The advanced collector is app/integrations/redis/index.js; the legacy one is app/integrations/redis.js beside it. Require the advanced one by full path.
  • --no-raw overrides --json. Passing both makes redis-cli fall back to the human-readable 1) 1) (integer) 0 format, which the SLOWLOG and CONFIG parsers cannot read. Never add it.
  • CONFIG GET returns a JSON object under RESP3 and a flat array otherwise. Both shapes must be accepted.
  • maxmemory = 0 means no limit. Return memoryLimitConfigured: false rather than a fake percentage against a limit that does not exist.
  • KEYS and OFFSET are InfluxQL reserved words and appear naturally in keyspace and replication queries — every alias in redisAdvanced.js must stay quoted, or the endpoint returns a runtime-only 500.
  • Redis slowlog ids restart at 0 when the server restarts, so the id alone is not unique over time. Document ids combine it with the run id.
  • Argument redaction is allow-list shaped, not deny-list shaped: an argument is redacted unless it is provably safe. Adding a new "safe" category means proving it cannot carry a value, not assuming it.
  • Commands are sent newline-delimited on stdin with ECHO markers between them, and the output is split back positionally. SECTION_NAMES must stay in the same order as the pushes in buildCommandScript — the two are read by index.
Last Updated:: 8/13/26, 12:54 AM
Contributors: mohammad
Prev
Kubernetes