Monitoring Redis Logs with ClickStack
This guide shows you how to monitor Redis with ClickStack by configuring the OpenTelemetry collector to ingest Redis server logs. You'll learn how to:
- Configure the OTel collector to parse Redis log format
- Deploy ClickStack with your custom configuration
- Use a pre-built dashboard to visualize Redis metrics (connections, commands, memory, errors)
A demo dataset with 10,000 sample logs is provided to test the integration before connecting your production Redis instances.
Time Required: 5-10 minutes.
Prerequisites
- ClickStack instance running
- Existing Redis installation (version 3.0 or newer)
- Access to Redis log files
Integration with existing Redis
This section covers configuring your existing Redis installation to send logs to ClickStack by modifying the ClickStack OTel collector configuration.
Verify Redis logging configuration
First, check your Redis logging configuration. Connect to Redis and check the log file location:
Common Redis log locations:
- Linux (apt/yum):
/var/log/redis/redis-server.log - macOS (Homebrew):
/usr/local/var/log/redis.log - Docker: Often logged to stdout, but can be configured to write to
/data/redis.log
If Redis is logging to stdout, configure it to write to a file by updating redis.conf:
After changing the configuration, restart Redis:
Create custom otel collector configuration
ClickStack allows you to extend the base OpenTelemetry Collector configuration by mounting a custom configuration file and setting an environment variable. The custom configuration is merged with the base configuration managed by HyperDX via OpAMP.
Create a file named redis-monitoring.yaml with the following configuration:
This configuration:
- Reads Redis logs from their standard location
- Uses
start_at: beginningto read all existing logs when the collector starts - Parses Redis's log format using regex to extract timestamp, level, and message
- Maps Redis log level symbols to OpenTelemetry severity levels
- Adds
source: redisattribute for filtering in HyperDX - Adds
service.nameresource attribute to identify the Redis service - Routes logs to the ClickHouse exporter via a dedicated pipeline
This configuration uses start_at: beginning, which reads all existing logs when ClickStack starts. This is ideal for initial setup and testing as you'll see logs immediately.
For production deployments where you want to avoid re-ingesting logs on collector restarts, change start_at: beginning to start_at: end. With start_at: end, the collector will only capture new log entries written after it starts.
Configure ClickStack to load custom configuration
To enable custom collector configuration in your existing ClickStack deployment, you must:
- Mount the custom config file at
/etc/otelcol-contrib/custom.config.yaml - Set the environment variable
CUSTOM_OTELCOL_CONFIG_FILE=/etc/otelcol-contrib/custom.config.yaml - Mount your Redis log directory so the collector can read them
Update your ClickStack deployment configuration to include these settings. This example uses docker compose with both ClickStack and Redis in the same compose file:
- Both containers share the same
redis-logsvolume - ClickStack mounts the logs as read-only (
:ro) following the principle of least privilege - The shared volume allows ClickStack to read Redis logs in real-time
- For standalone deployments, ensure the log directory is accessible to both Redis and ClickStack
Demo dataset
For users who want to test the Redis integration before configuring their production systems, we provide a sample dataset of pre-generated Redis logs with realistic patterns.
Download the sample dataset
Download the sample log file and update timestamps to the current time:
The dataset includes:
- 10,000 log entries with realistic Redis activity distributed over 24 hours
- Traffic peaks during typical busy hours (9-11am, 1-3pm, 7-9pm)
- Mix of log levels: INFO (70-85%), WARNING (7-27%), DEBUG (3-5%)
- Varied attributes: multiple process IDs, roles, client addresses, and metrics
- Common events: connections, commands, persistence operations, memory warnings
Create test collector configuration
Create a file named redis-demo.yaml with the following configuration:
Run ClickStack with demo configuration
Run ClickStack with the demo logs and configuration:
This mounts the log file directly into the container. This is done for testing purposes with static demo data.
Verify logs in HyperDX
Once ClickStack is running:
- Open HyperDX at http://localhost:8080
- Navigate to the Logs view
- Set time range to "Last 1 Day"
- Filter by
source: redis-demo - You should see 10,000 log entries
Dashboards and visualization
To help you get started monitoring Redis with ClickStack, we provide essential visualizations for Redis logs.
Import Pre-built Dashboard
- Open HyperDX and navigate to the Dashboards section.
- Click "Import Dashboard" in the upper right corner under the ellipses.
- Upload the redis-logs-dashboard.json file and click finish import.
The dashboard will be created with all visualizations pre-configured.
Troubleshooting
Custom config not loading
Verify the environment variable is set correctly:
Check that the custom config file is mounted:
View the custom config content:
Check the effective config includes your filelog receiver:
No logs appearing in HyperDX
Ensure Redis is writing logs to a file:
Check Redis is actively logging:
Verify the collector can read the logs:
Check for errors in the collector logs:
If using docker-compose, verify shared volumes:
Logs not parsing correctly
Verify Redis log format matches expected pattern:
If your Redis logs have a different format, you may need to adjust the regex pattern in the regex_parser operator. The standard format is:
pid:role timestamp level message- Example:
12345:M 28 Oct 2024 14:23:45.123 * Server started
Next Steps
If you want to explore further, here are some next steps to experiment with your dashboard
- Set up alerts for critical metrics (error rates, latency thresholds)
- Create additional dashboards for specific use cases (API monitoring, security events)