Connects Claude to a running Valkey or Redis instance and surfaces real time observability data through MCP tools. You get memory stats, client connections, keyspace metrics, slow queries, and cluster health without leaving your editor. Built on top of BetterDB's monitoring stack, which they also ship as a standalone web dashboard and CLI. Useful when you're debugging cache behavior, investigating performance issues, or need to check database state while writing code that hits Redis. The same company ships semantic caching libraries for LLMs, so the MCP integration feels like a natural extension of that tooling.
claude mcp add monitor --env BETTERDB_URL=YOUR_BETTERDB_URL --env BETTERDB_TOKEN=YOUR_BETTERDB_TOKEN --env BETTERDB_INSTANCE_ID=YOUR_BETTERDB_INSTANCE_ID -- npx -y @betterdb/mcpRun in your terminal. Replace YOUR_* placeholders with real values; add --scope user to install for every project.
Review the command, arguments, and environment values before installing — MCP servers run with your local permissions.
Verified live against the running server on Jun 10, 2026.
list_instancesList all Valkey/Redis instances registered in BetterDB. Shows connection status and capabilities.List all Valkey/Redis instances registered in BetterDB. Shows connection status and capabilities.
No parameters — call it with no arguments.
select_instanceSelect which instance subsequent tool calls operate on.1 paramsSelect which instance subsequent tool calls operate on.
instanceId*stringadd_connectionAdd a new Valkey/Redis connection to BetterDB. Optionally set it as the active default.6 paramsAdd a new Valkey/Redis connection to BetterDB. Optionally set it as the active default.
host*stringname*stringportintegerpasswordstringusernamestringsetAsDefaultbooleantest_connectionTest a Valkey/Redis connection without persisting it. Use before add_connection to validate credentials.5 paramsTest a Valkey/Redis connection without persisting it. Use before add_connection to validate credentials.
host*stringname*stringportintegerpasswordstringusernamestringremove_connectionRemove a connection from BetterDB.1 paramsRemove a connection from BetterDB.
instanceId*stringset_default_connectionSet a connection as the active default for BetterDB.1 paramsSet a connection as the active default for BetterDB.
instanceId*stringget_infoGet INFO stats for the active instance. Contains all health data: memory, clients, replication, keyspace, stats (hit rate, ops/sec), and server info. Optionally filter to a section: server|clients|memory|stats|replication|keyspace.2 paramsGet INFO stats for the active instance. Contains all health data: memory, clients, replication, keyspace, stats (hit rate, ops/sec), and server info. Optionally filter to a section: server|clients|memory|stats|replication|keyspace.
sectionstringinstanceIdstringget_slowlogGet the most recent slow commands from the slowlog.2 paramsGet the most recent slow commands from the slowlog.
countnumberinstanceIdstringget_commandlogGet the most recent entries from COMMANDLOG (Valkey 8+ only, superset of slowlog).2 paramsGet the most recent entries from COMMANDLOG (Valkey 8+ only, superset of slowlog).
countnumberinstanceIdstringget_latencyGet latency event history for the active instance.1 paramsGet latency event history for the active instance.
instanceIdstringget_memoryGet memory diagnostics: MEMORY DOCTOR assessment and MEMORY STATS breakdown.1 paramsGet memory diagnostics: MEMORY DOCTOR assessment and MEMORY STATS breakdown.
instanceIdstringget_clientsGet the active client list with connection details.1 paramsGet the active client list with connection details.
instanceIdstringget_healthGet a synthetic health summary for the active instance: keyspace hit rate, memory fragmentation ratio, connected clients, replication lag (replicas only), and keyspace size. Use this as the first call when investigating an instance — it surfaces the most actionable signals wit...1 paramsGet a synthetic health summary for the active instance: keyspace hit rate, memory fragmentation ratio, connected clients, replication lag (replicas only), and keyspace size. Use this as the first call when investigating an instance — it surfaces the most actionable signals wit...
instanceIdstringget_slowlog_patternsGet analyzed slowlog patterns from persisted storage. Groups slow commands by normalized pattern, showing frequency, average duration, and example commands. Survives slowlog buffer rotation — data goes back as far as BetterDB has been running.2 paramsGet analyzed slowlog patterns from persisted storage. Groups slow commands by normalized pattern, showing frequency, average duration, and example commands. Survives slowlog buffer rotation — data goes back as far as BetterDB has been running.
limitnumberinstanceIdstringget_commandlog_historyGet persisted COMMANDLOG entries from storage (Valkey 8+ only). Supports time range filtering to investigate specific incidents. Returns empty with a note if COMMANDLOG is not supported on this instance.6 paramsGet persisted COMMANDLOG entries from storage (Valkey 8+ only). Supports time range filtering to investigate specific incidents. Returns empty with a note if COMMANDLOG is not supported on this instance.
limitnumbercommandstringendTimenumberstartTimenumberinstanceIdstringminDurationnumberget_commandlog_patternsGet analyzed COMMANDLOG patterns from persisted storage (Valkey 8+ only). Like get_slowlog_patterns but includes large-request and large-reply patterns in addition to slow commands.4 paramsGet analyzed COMMANDLOG patterns from persisted storage (Valkey 8+ only). Like get_slowlog_patterns but includes large-request and large-reply patterns in addition to slow commands.
limitnumberendTimenumberstartTimenumberinstanceIdstringget_anomaliesGet anomaly detection events from persisted storage. BetterDB continuously runs Z-score analysis on memory, hit rate, CPU, and other metrics — this returns the detected anomalies. Use to investigate what triggered an alert or correlate with an incident.4 paramsGet anomaly detection events from persisted storage. BetterDB continuously runs Z-score analysis on memory, hit rate, CPU, and other metrics — this returns the detected anomalies. Use to investigate what triggered an alert or correlate with an incident.
limitnumberstartTimenumberinstanceIdstringmetricTypestringget_client_activityGet time-bucketed client activity from persisted snapshots. Shows connection counts, command distribution, and buffer usage over time. Use startTime/endTime to focus on a specific incident window.4 paramsGet time-bucketed client activity from persisted snapshots. Shows connection counts, command distribution, and buffer usage over time. Use startTime/endTime to focus on a specific incident window.
endTimenumberstartTimenumberinstanceIdstringbucketSizeMinutesnumberget_hot_keysGet hot key tracking data from persisted storage. BetterDB periodically scans keys using LFU frequency scores (when maxmemory-policy is an LFU variant) or OBJECT IDLETIME / COMMANDLOG-derived frequency. Each snapshot captures the top keys ranked by access frequency. Use this t...4 paramsGet hot key tracking data from persisted storage. BetterDB periodically scans keys using LFU frequency scores (when maxmemory-policy is an LFU variant) or OBJECT IDLETIME / COMMANDLOG-derived frequency. Each snapshot captures the top keys ranked by access frequency. Use this t...
limitnumberendTimenumberstartTimenumberinstanceIdstringget_cluster_nodesDiscover all nodes in the Valkey cluster — role (master/replica), address, health status, and slot ranges. Returns an error message if this instance is not running in cluster mode.1 paramsDiscover all nodes in the Valkey cluster — role (master/replica), address, health status, and slot ranges. Returns an error message if this instance is not running in cluster mode.
instanceIdstringget_cluster_node_statsGet per-node performance stats: memory usage, ops/sec, connected clients, replication offset, and CPU. Use this to identify hot nodes, lagging replicas, or uneven load distribution.1 paramsGet per-node performance stats: memory usage, ops/sec, connected clients, replication offset, and CPU. Use this to identify hot nodes, lagging replicas, or uneven load distribution.
instanceIdstringget_cluster_slowlogGet the aggregated slowlog across ALL nodes in the cluster. This is the primary tool for finding slow commands in cluster mode — per-node slowlogs are incomplete. Returns an error message if not in cluster mode.2 paramsGet the aggregated slowlog across ALL nodes in the cluster. This is the primary tool for finding slow commands in cluster mode — per-node slowlogs are incomplete. Returns an error message if not in cluster mode.
limitnumberinstanceIdstringget_slot_statsGet per-slot key counts and CPU usage (Valkey 8.0+ only). Use orderBy='cpu-usec' to find hot slots, or 'key-count' to find the most populated slots. Returns an error message if not supported.3 paramsGet per-slot key counts and CPU usage (Valkey 8.0+ only). Use orderBy='cpu-usec' to find hot slots, or 'key-count' to find the most populated slots. Returns an error message if not supported.
limitnumberorderBystringkey-count · cpu-usecinstanceIdstringget_latency_historyGet the full latency history for a named event (e.g. 'command', 'fast-command'). Call get_latency first to see which event names are available, then use this to investigate a specific event's trend over time.2 paramsGet the full latency history for a named event (e.g. 'command', 'fast-command'). Call get_latency first to see which event names are available, then use this to investigate a specific event's trend over time.
eventName*stringinstanceIdstringget_acl_auditGet persisted ACL audit log entries from storage. Filter by username, reason (auth, command, key, channel), or time range. Use this to investigate why a connection is failing or audit access patterns.6 paramsGet persisted ACL audit log entries from storage. Filter by username, reason (auth, command, key, channel), or time range. Use this to investigate why a connection is failing or audit access patterns.
limitnumberreasonstringendTimenumberusernamestringstartTimenumberinstanceIdstringstart_monitorStart the BetterDB monitor as a persistent background process. If already running, returns the existing URL. The monitor persists across MCP sessions and must be stopped explicitly with stop_monitor.2 paramsStart the BetterDB monitor as a persistent background process. If already running, returns the existing URL. The monitor persists across MCP sessions and must be stopped explicitly with stop_monitor.
portintegerstoragestringsqlite · memorydefault: sqlitecache_listList all caches (semantic_cache and agent_cache) registered for the active instance, with hit rate and total ops.1 paramsList all caches (semantic_cache and agent_cache) registered for the active instance, with hit rate and total ops.
instanceIdstringcache_healthDetailed health for a single cache. Response branches by type: semantic_cache reports category_breakdown + uncertain_hit_rate; agent_cache reports tool_breakdown.2 paramsDetailed health for a single cache. Response branches by type: semantic_cache reports category_breakdown + uncertain_hit_rate; agent_cache reports tool_breakdown.
cache_name*stringinstanceIdstringcache_threshold_recommendationThreshold-tuning recommendation for a semantic_cache, based on the rolling similarity-score window. Errors with INVALID_CACHE_TYPE on agent_cache.4 paramsThreshold-tuning recommendation for a semantic_cache, based on the rolling similarity-score window. Errors with INVALID_CACHE_TYPE on agent_cache.
categorystringcache_name*stringinstanceIdstringminSamplesintegercache_tool_effectivenessPer-tool hit rate, cost saved, and TTL recommendation for an agent_cache. Errors with INVALID_CACHE_TYPE on semantic_cache.2 paramsPer-tool hit rate, cost saved, and TTL recommendation for an agent_cache. Errors with INVALID_CACHE_TYPE on semantic_cache.
cache_name*stringinstanceIdstringcache_similarity_distributionHistogram of recent similarity scores (20 buckets, width 0.1) for a semantic_cache. Errors on agent_cache.4 paramsHistogram of recent similarity scores (20 buckets, width 0.1) for a semantic_cache. Errors on agent_cache.
categorystringcache_name*stringinstanceIdstringwindow_hoursintegercache_recent_changesRecent proposals for a single cache (any status), so agents can avoid re-proposing pending or recently-applied changes. Newest first.3 paramsRecent proposals for a single cache (any status), so agents can avoid re-proposing pending or recently-applied changes. Newest first.
limitintegercache_name*stringinstanceIdstringcache_propose_threshold_adjustPropose a semantic-cache similarity-threshold change for review. Creates a pending proposal that requires human approval before any change is applied. Reasoning must be at least 20 characters.5 paramsPropose a semantic-cache similarity-threshold change for review. Creates a pending proposal that requires human approval before any change is applied. Reasoning must be at least 20 characters.
categoryvaluereasoning*stringcache_name*stringinstanceIdstringnew_threshold*numbercache_propose_tool_ttl_adjustPropose an agent-cache per-tool TTL change for review. Creates a pending proposal that requires human approval. Reasoning must be at least 20 characters.5 paramsPropose an agent-cache per-tool TTL change for review. Creates a pending proposal that requires human approval. Reasoning must be at least 20 characters.
reasoning*stringtool_name*stringcache_name*stringinstanceIdstringnew_ttl_seconds*integercache_propose_invalidatePropose a cache invalidation for review. Filter shape depends on cache type: semantic_cache requires filter_kind=valkey_search + filter_expression; agent_cache requires filter_kind in (tool|key_prefix|session) + filter_value. Warns when estimated_affected exceeds 10000.7 paramsPropose a cache invalidation for review. Filter shape depends on cache type: semantic_cache requires filter_kind=valkey_search + filter_expression; agent_cache requires filter_kind in (tool|key_prefix|session) + filter_value. Warns when estimated_affected exceeds 10000.
reasoning*stringcache_name*stringinstanceIdstringfilter_kind*stringvalkey_search · tool · key_prefix · sessionfilter_valuestringfilter_expressionstringestimated_affected*integercache_list_pending_proposalsList pending cache proposals for the active instance, newest first. Optionally filter by cache_name.3 paramsList pending cache proposals for the active instance, newest first. Optionally filter by cache_name.
limitintegercache_namestringinstanceIdstringcache_get_proposalFetch a single cache proposal by id, including its audit trail.1 paramsFetch a single cache proposal by id, including its audit trail.
proposal_id*stringcache_approve_proposalApprove a pending proposal. Synchronously applies the change to Valkey and returns the terminal status (applied|failed). Idempotent: a second call on an already-applied proposal returns the cached result.2 paramsApprove a pending proposal. Synchronously applies the change to Valkey and returns the terminal status (applied|failed). Idempotent: a second call on an already-applied proposal returns the cached result.
actorstringproposal_id*stringcache_reject_proposalReject a pending proposal. Optionally records a reason in the audit trail.3 paramsReject a pending proposal. Optionally records a reason in the audit trail.
actorstringreasonstringproposal_id*stringcache_edit_and_approve_proposalEdit an existing pending proposal and approve it in one step. Provide exactly one edit field matching the proposal type: new_threshold for threshold_adjust, new_ttl_seconds for tool_ttl_adjust. Invalidate proposals are not editable.4 paramsEdit an existing pending proposal and approve it in one step. Provide exactly one edit field matching the proposal type: new_threshold for threshold_adjust, new_ttl_seconds for tool_ttl_adjust. Invalidate proposals are not editable.
actorstringproposal_id*stringnew_thresholdnumbernew_ttl_secondsintegerstop_monitorStop a persistent BetterDB monitor process that was previously started with start_monitor or --autostart --persist.Stop a persistent BetterDB monitor process that was previously started with start_monitor or --autostart --persist.
No parameters — call it with no arguments.
A monorepo application for monitoring Valkey/Redis databases with a NestJS backend and React frontend.
Website | Docker Hub | npm | Documentation | Blog
BetterDB is built by BetterDB Inc., a public benefit company operating under the OCV Open Charter.
betterdb-monitor/
├── apps/
│ ├── api/ # NestJS backend (Fastify)
│ └── web/ # React frontend (Vite)
├── packages/ # Published packages (see below)
├── docs/ # Documentation site (Jekyll)
├── docker-compose.yml # Local Valkey (port 6380) and Redis (port 6382) for testing
└── package.json # Workspace root
This monorepo ships several standalone packages. See packages/ for the full list.
| Package | Language | Registry |
|---|---|---|
@betterdb/semantic-cache | TypeScript | npm |
betterdb-semantic-cache | Python | PyPI |
@betterdb/agent-cache | TypeScript | npm |
betterdb-agent-cache | Python | PyPI |
| Package | Language | Registry |
|---|---|---|
@betterdb/monitor | TypeScript | npm |
@betterdb/mcp | TypeScript | npm |
@betterdb/agent | TypeScript | npm |
| Package | Language | Description |
|---|---|---|
cache-benchmark | Python | Replay harness for benchmarking semantic caches against public datasets |
pnpm install
cp .env.example .env
pnpm docker:up
To connect to Redis instead of Valkey, update .env:
DB_PORT=6382
pnpm dev
The application will be available at:
Run only the API:
pnpm dev:api
Run only the web frontend:
pnpm dev:web
Stop Docker containers:
pnpm docker:down
Build for production:
pnpm build
The easiest way to run BetterDB Monitor without Docker:
npx @betterdb/monitor
On first run, an interactive setup wizard will guide you through configuration:
Configuration is saved to ~/.betterdb/config.json.
npm install -g @betterdb/monitor
betterdb
betterdb --setup # Re-run setup wizard, then start server
betterdb --port 8080 # Override server port
betterdb --db-host 1.2.3.4 # Override database host
betterdb --help # Show all options
To use SQLite storage with the CLI, install better-sqlite3:
npm install -g better-sqlite3
pnpm docker:build
For multi-arch builds (AMD64 + ARM64), first set up buildx:
docker buildx create --name mybuilder --use --bootstrap
Then build:
pnpm docker:build:multiarch
The Docker image contains only the monitoring application (backend + frontend). It requires:
docker run -d \
--name betterdb-monitor \
-p 3001:3001 \
-e DB_HOST=your-valkey-host \
-e DB_PORT=6379 \
-e DB_PASSWORD=your-password \
-e STORAGE_TYPE=memory \
betterdb/monitor
You can run the application on any port by setting the PORT environment variable with -e PORT=<port>:
docker run -d \
--name betterdb-monitor \
-p 8080:8080 \
-e PORT=8080 \
-e DB_HOST=your-valkey-host \
-e DB_PORT=6379 \
-e DB_PASSWORD=your-password \
-e STORAGE_TYPE=memory \
betterdb/monitor
Note: When not using --network host, make sure the -p flag port mapping matches the PORT environment variable (e.g., -p 8080:8080 -e PORT=8080).
docker run -d \
--name betterdb-monitor \
-p 3001:3001 \
-e DB_HOST=your-valkey-host \
-e DB_PORT=6379 \
-e DB_PASSWORD=your-password \
-e STORAGE_TYPE=postgres \
-e STORAGE_URL=postgresql://user:pass@postgres-host:5432/dbname \
betterdb/monitor
If your Valkey and PostgreSQL are running on the same host:
docker run -d \
--name betterdb-monitor \
--network host \
-e DB_HOST=localhost \
-e DB_PORT=6380 \
-e DB_PASSWORD=devpassword \
-e STORAGE_TYPE=postgres \
-e STORAGE_URL=postgresql://dev:devpass@localhost:5432/postgres \
betterdb/monitor
To automatically remove any existing container with the same name:
docker rm -f betterdb-monitor 2>/dev/null; docker run -d \
--name betterdb-monitor \
-p 3001:3001 \
-e DB_HOST=your-valkey-host \
-e DB_PORT=6379 \
-e DB_PASSWORD=your-password \
-e STORAGE_TYPE=postgres \
-e STORAGE_URL=postgresql://user:pass@postgres-host:5432/dbname \
betterdb/monitor
| Variable | Required | Default | Description |
|---|---|---|---|
DB_HOST | Yes | localhost | Valkey/Redis host to monitor |
DB_PORT | No | 6379 | Valkey/Redis port |
DB_PASSWORD | No | - | Valkey/Redis password |
DB_USERNAME | No | default | Valkey/Redis ACL username |
DB_TYPE | No | auto | Database type: auto, valkey, or redis |
STORAGE_TYPE | No | memory | Storage backend: memory or postgres |
STORAGE_URL | Conditional | - | PostgreSQL connection URL (required if STORAGE_TYPE=postgres) |
PORT | No | 3001 | Application HTTP port |
NODE_ENV | No | production | Node environment |
ANOMALY_DETECTION_ENABLED | No | true | Enable anomaly detection |
ANOMALY_PROMETHEUS_INTERVAL_MS | No | 30000 | Prometheus summary update interval (ms) |
Once running, access the web interface at:
http://localhost:3001http://localhost:3001/healthhttp://localhost:3001/prometheus/metricsnode:20-alpinelinux/amd64, linux/arm64docker logs -f betterdb-monitor
docker stop betterdb-monitor
docker rm betterdb-monitor
For deployments running RediSearch or valkey-search, BetterDB ships a dedicated Vector / AI tab that surfaces FT.SEARCH ops/sec and average latency over time alongside per-index health (docs, records, deleted docs, indexing failures, backfill progress). Stale Prometheus labels are reconciled when indexes are dropped, and the tab hides automatically when the Search module isn't available. See docs/vector-ai/ for the full walkthrough and screenshots.
| Database | Minimum Version | Supported Features |
|---|---|---|
| Valkey | 8.0+ | All features including COMMANDLOG and CLUSTER SLOT-STATS |
| Redis | 6.0+ | All features except COMMANDLOG and CLUSTER SLOT-STATS |
| Feature | Command | Valkey | Redis |
|---|---|---|---|
| Server Info | INFO | Yes | Yes |
| Health Check | PING | Yes | Yes |
| Slowlog | SLOWLOG | Yes | Yes (2.2+) |
| Client List | CLIENT LIST | Yes | Yes (2.4+) |
| Latency Monitor | LATENCY | Yes | Yes (2.8+) |
| Memory Stats | MEMORY STATS | Yes | Yes (4.0+) |
| ACL Log | ACL LOG | Yes | Yes (6.0+) |
| Command Log | COMMANDLOG | Yes (8.1+) | No (Valkey-only) |
| Cluster Slot Stats | CLUSTER SLOT-STATS | Yes (8.0+) | No (Valkey-only) |
Unified Adapter Pattern: The backend uses a unified UnifiedDatabaseAdapter that works seamlessly with both Valkey and Redis through the wire-compatible iovalkey client library.
Auto-detection: The application automatically detects whether it's connecting to Valkey or Redis by inspecting the INFO response.
Capability Detection: Features like Command Log (Valkey 8.1+) and Slot Stats (Valkey 8.0+) are automatically detected based on database type and version. The UI gracefully degrades when connecting to Redis, showing only supported features.
Graceful Degradation: When connected to Redis, Valkey-specific features return clear error messages indicating they're not supported, while all shared features work identically.
Metrics are exposed at GET /prometheus/metrics in Prometheus text format.
| Metric | Type | Labels | Description |
|---|---|---|---|
betterdb_acl_denied | gauge | - | Total ACL denied events captured |
betterdb_acl_denied_by_reason | gauge | reason | ACL denied events by reason |
betterdb_acl_denied_by_user | gauge | username | ACL denied events by username |
| Metric | Type | Labels | Description |
|---|---|---|---|
betterdb_client_connections_current | gauge | - | Current number of client connections |
betterdb_client_connections_peak | gauge | - | Peak connections in retention period |
betterdb_client_connections_by_name | gauge | client_name | Current connections by client name |
betterdb_client_connections_by_user | gauge | user | Current connections by ACL user |
| Metric | Type | Labels | Description |
|---|---|---|---|
betterdb_slowlog_pattern_count | gauge | pattern | Number of slow queries per pattern |
betterdb_slowlog_pattern_avg_duration_us | gauge | pattern | Average duration in microseconds per pattern |
betterdb_slowlog_pattern_percentage | gauge | pattern | Percentage of slow queries per pattern |
| Metric | Type | Labels | Description |
|---|---|---|---|
betterdb_commandlog_large_request | gauge | - | Total large request entries |
betterdb_commandlog_large_reply | gauge | - | Total large reply entries |
betterdb_commandlog_large_request_by_pattern | gauge | pattern | Large request count by command pattern |
betterdb_commandlog_large_reply_by_pattern | gauge | pattern | Large reply count by command pattern |
| Metric | Type | Labels | Description |
|---|---|---|---|
betterdb_process_cpu_user_seconds_total | counter | - | Total user CPU time spent in seconds |
betterdb_process_cpu_system_seconds_total | counter | - | Total system CPU time spent in seconds |
betterdb_process_cpu_seconds_total | counter | - | Total user and system CPU time spent in seconds |
betterdb_process_start_time_seconds | gauge | - | Start time of the process since unix epoch in seconds |
betterdb_process_resident_memory_bytes | gauge | - | Resident memory size in bytes |
betterdb_process_virtual_memory_bytes | gauge | - | Virtual memory size in bytes |
betterdb_process_heap_bytes | gauge | - | Process heap size in bytes |
betterdb_process_open_fds | gauge | - | Number of open file descriptors |
betterdb_process_max_fds | gauge | - | Maximum number of open file descriptors |
| Metric | Type | Labels | Description |
|---|---|---|---|
betterdb_nodejs_eventloop_lag_seconds | gauge | - | Lag of event loop in seconds |
betterdb_nodejs_eventloop_lag_min_seconds | gauge | - | Minimum recorded event loop delay |
betterdb_nodejs_eventloop_lag_max_seconds | gauge | - | Maximum recorded event loop delay |
betterdb_nodejs_eventloop_lag_mean_seconds | gauge | - | Mean of recorded event loop delays |
betterdb_nodejs_eventloop_lag_stddev_seconds | gauge | - | Standard deviation of recorded event loop delays |
betterdb_nodejs_eventloop_lag_p50_seconds | gauge | - | 50th percentile of recorded event loop delays |
betterdb_nodejs_eventloop_lag_p90_seconds | gauge | - | 90th percentile of recorded event loop delays |
betterdb_nodejs_eventloop_lag_p99_seconds | gauge | - | 99th percentile of recorded event loop delays |
| Metric | Type | Labels | Description |
|---|---|---|---|
betterdb_nodejs_active_resources | gauge | type | Active resources keeping the event loop alive |
betterdb_nodejs_active_resources_total | gauge | - | Total number of active resources |
betterdb_nodejs_active_handles | gauge | type | Active libuv handles by type |
betterdb_nodejs_active_handles_total | gauge | - | Total number of active handles |
betterdb_nodejs_active_requests | gauge | type | Active libuv requests by type |
betterdb_nodejs_active_requests_total | gauge | - | Total number of active requests |
betterdb_nodejs_version_info | gauge | version, major, minor, patch | Node.js version info |
| Metric | Type | Labels | Description |
|---|---|---|---|
betterdb_nodejs_heap_size_total_bytes | gauge | - | Process heap size from Node.js in bytes |
betterdb_nodejs_heap_size_used_bytes | gauge | - | Process heap size used from Node.js in bytes |
betterdb_nodejs_external_memory_bytes | gauge | - | Node.js external memory size in bytes |
betterdb_nodejs_heap_space_size_total_bytes | gauge | space | Process heap space size total in bytes |
betterdb_nodejs_heap_space_size_used_bytes | gauge | space | Process heap space size used in bytes |
betterdb_nodejs_heap_space_size_available_bytes | gauge | space | Process heap space size available in bytes |
| Metric | Type | Labels | Description |
|---|---|---|---|
betterdb_nodejs_gc_duration_seconds | histogram | kind | Garbage collection duration (major, minor, incremental, weakcb) |
Edit .env to configure the Valkey/Redis database connection:
DB_HOST=localhost
DB_PORT=6379
DB_USERNAME=default
DB_PASSWORD=devpassword
DB_TYPE=auto # 'valkey' | 'redis' | 'auto'
BetterDB Monitor supports multiple storage backends for persisting audit trail and client analytics data:
STORAGE_TYPE=sqlite
STORAGE_SQLITE_FILEPATH=./data/audit.db # Optional, defaults to this path
apps/api/data/audit.dbSTORAGE_TYPE=postgres
STORAGE_URL=postgresql://username:password@host:port/database
postgresql://dev:devpass@localhost:5432/postgresSTORAGE_TYPE=memory
STORAGE_TYPE=sqlite \
DB_HOST=localhost \
DB_PORT=6380 \
DB_PASSWORD=devpassword \
pnpm dev:api
# Start PostgreSQL (if using docker-compose)
docker compose up -d postgres
# Run API with PostgreSQL
STORAGE_TYPE=postgres \
STORAGE_URL=postgresql://betterdb:devpassword@localhost:5432/betterdb \
DB_HOST=localhost \
DB_PORT=6380 \
DB_PASSWORD=devpassword \
pnpm dev:api
STORAGE_TYPE=memory \
DB_HOST=localhost \
DB_PORT=6380 \
DB_PASSWORD=devpassword \
pnpm dev:api
The codebase is structured to make it easy to add new monitoring features:
apps/api/src/apps/web/src/api/packages/shared/src/types/any types allowedMIT
BETTERDB_URLURL of the BetterDB monitor instance
BETTERDB_TOKENsecretMCP authentication token generated from the BetterDB Settings page
BETTERDB_INSTANCE_IDInstance ID to target when using multi-instance cloud deployments
io.github.infoinlet-marketplace/mcp-observability
com.mcparmory/datadog
thotischner/observability-mcp
io.github.tantiope/datadog-mcp
io.github.us-all/datadog
oaslananka/mcp-health-monitor