Skip to main content
Collect Redis server logs with an OpenTelemetry collector and send them to ClickHouse Observability. Use the demo dataset to try the integration without installing Redis.

Prerequisites

  • A ClickHouse Observability service
  • Docker to run the collector examples, or an existing OpenTelemetry Collector Contrib deployment
  • For your own logs, an existing Redis installation and access to its log files

Connection details

Open ClickHouse Observability and go to Team Settings → Data → Managed Telemetry. Copy your OTLP HTTP endpoint and API key. You can use Copy connection details to copy the configuration, or Reveal key to view the masked key.For the OTLP exporter examples below, set these variables in the terminal where you will run the collector:
Replace the placeholders with the exact endpoint, including its port, and API key from your service. Use the base HTTP endpoint without a /v1/logs suffix; the exporter appends the signal path.
The endpoint must be reachable from the collector container. For a destination collector running on this computer, use http://host.docker.internal:4318. The Docker commands below include the host mapping.

Integration with existing Redis

1

Verify Redis logging configuration

Check where Redis writes its logs:
Common Redis log locations:
  • Linux (apt/yum): /var/log/redis/redis-server.log
  • macOS (Homebrew): /usr/local/var/log/redis.log or /opt/homebrew/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:
Ensure the log directory exists and Redis can write to it. After changing the configuration, restart Redis using your installation’s service name:
2

Configure the collector

Save this as redis-monitoring.yaml:
This configuration parses the process ID, role, timestamp, log level, and message. It sets service.name to redis-service and maps Redis log levels to SeverityText for the dashboard. Redis notice messages (*) map to info, warnings (#) to warn, and debug/verbose messages (. and -) to debug.Redis log timestamps do not include a timezone. Set location to your Redis server’s timezone, such as America/Chicago; the example uses UTC. Original timestamps and the log body are preserved. With start_at: end, only new entries are read when the collector first opens the file.
3

Run the collector

Set the connection variables, then run from the directory containing redis-monitoring.yaml. Adjust the host log-directory path and the receiver’s include filename to match your installation:
Keep this terminal open and generate Redis activity that writes new log entries. The collector must be able to read the mounted files.
4

Verify logs

Open Search, select Logs, and filter for ServiceName:redis-service. Select a time range covering your new logs. Expand an entry to inspect SeverityText and the parsed fields under LogAttributes.

Demo dataset

The sample contains 10,000 Redis server log entries. Set the connection variables before starting.
1

Download the sample dataset

2

Configure the demo collector

Save this as redis-demo.yaml in the download directory:
The demo-only transform/demo_timestamps processor shifts the sample into roughly the past 24 hours, ending two minutes before ingestion, while retaining its traffic pattern. The original timestamp attribute and log body stay unchanged. Omit this processor for your own Redis logs.
3

Run the demo collector

From the directory containing redis-server.log and redis-demo.yaml, run:
Leave the terminal open while you verify ingestion. Stop the collector with Ctrl+C when finished. Running the demo again re-ingests the sample with refreshed timestamps because this example does not persist file offsets.
4

Verify the demo logs

Open Search, select Logs, filter for ServiceName:redis-demo, and select Last 2 days. Expand a log entry to inspect the parsed attributes and severity.

Dashboards and visualization

1

2

Import the dashboard

  1. Open Dashboards and click Import in the upper-right corner.
  2. Upload redis-logs-dashboard.json.
  3. Map the charts to your Logs source and click Finish Import.
3

View the dashboard

Filter for ServiceName:redis-demo for the sample, or ServiceName:redis-service for your own logs. For the demo, select Last 2 days.The dashboard shows log volume and severity. Its Request rate chart counts log entries, not Redis commands.

Troubleshooting

Collector fails to start

Check the collector terminal for configuration errors. Verify the YAML file is mounted at the documented path and the endpoint and any required authentication variables are set in the terminal where you run Docker.

No logs appearing

  • Check the collector output for authentication or export errors and verify your connection details.
  • Run redis-cli CONFIG GET logfile to check that Redis writes to a file. Ensure the collector can read it and that its mounted path matches the receiver’s include path.
  • With start_at: end, generate new log entries after starting the collector.
  • Check the Logs source, service-name filter, and time range. For the demo, include transform/demo_timestamps in the pipeline and select Last 2 days.

Logs not parsing correctly

The receiver expects Redis’s standard pid:role timestamp level message format. Check your log file and adjust the regex if your format differs. Set the time parser’s location to the Redis server’s timezone.

Next steps