Integration with Redis Metrics
This guide provides step-by-step instructions to collect and monitor Redis metrics using OpenTelemetry Collector Contrib and forward them to OpenObserve.
Overview
Redis is a powerful in-memory data structure store, widely used as a database, cache, and message broker. It supports diverse use cases like caching, session management, and real-time data streaming for applications such as chat systems and gaming.
To monitor Redis, we will use the OpenTelemetry Collector Redis receiver, which fetches performance metrics using the INFO
command and converts them into OpenTelemetry metrics that can be pushed to OpenObserve.
Steps to Integrate
Prerequisites
- Running Redis instance(s)
- OpenObserve account (Cloud or Self-Hosted)
- Basic understanding of OpenTelemetry concepts
Step 1: Prepare Your Redis Environment
Ensure your Redis server is running and accessible on localhost:6379
(or your target host/port).
To enable authentication, update redis.conf
:
Restart Redis after editing the config.
Step 2: Install OpenTelemetry Collector Contrib
Download and install the latest release of otelcol-contrib
:
curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.115.1/otelcol-contrib_0.115.1_darwin_arm64.tar.gz
tar -xvf otelcol-contrib_0.115.1_darwin_arm64.tar.gz
sudo mv otelcol-contrib /usr/local/bin/
otelcol-contrib --version
Replace
v0.115.1
with the latest version for your OS/architecture.
Step 3: Configure the Collector
Create a file named config.yaml
with the following configuration:
receivers:
redis:
endpoint: "localhost:6379"
collection_interval: 10s
password: ${env:REDIS_PASSWORD}
processors:
batch:
send_batch_size: 10000
send_batch_max_size: 11000
timeout: 10s
exporters:
otlphttp/openobserve:
endpoint: https://<your-openobserve-endpoint>/api/default
headers:
Authorization: Basic <your_auth_token>
stream-name: default
service:
pipelines:
metrics:
receivers: [redis]
processors: [batch]
exporters: [otlphttp/openobserve]
Replace <your-openobserve-endpoint>
and <your_auth_token>
with your OpenObserve details.
A full list of metrics collected is available in the Redis receiver documentation.
Step 4: Run the Collector
Start the Collector with your configuration:
Step 5: Visualize in OpenObserve
-
Open OpenObserve → Streams and select your metrics stream.
-
Create dashboards to monitor Redis memory, connections, and operations.
Troubleshooting
Authentication Errors
- Check that
requirepass
is set inredis.conf
if using a password. - Ensure
REDIS_PASSWORD
env variable matches your Redis configuration.
Connection Refused
- Verify Redis is running and accessible on the specified host/port.
- Check firewall or container networking.
TLS Issues
- If using TLS, configure
ca_file
,cert_file
, andkey_file
properly. - Use
tls.insecure_skip_verify: true
only for testing.
No Metrics in OpenObserve
- Inspect Collector logs for errors.
- Verify exporter endpoint and token configuration.
- Ensure OpenObserve is reachable from the Collector.