Monitoring Redis Performance using OpenTelemetry
This tutorial explains how you can use OpenTelemetry and Uptrace to monitor Redis Server and Cluster performance. Besides using Otel Collector to monitor your Redis servers, you can also use OpenTelemetry to instrument your applications with traces, metrics, and logs.
What is OpenTelemetry?
OpenTelemetry is an open source and vendor-neutral API for OpenTelemetry tracing (including logs and errors) and OpenTelemetry metrics.
Otel specifies how to collect and export telemetry data in a vendor agnostic way. With OpenTelemetry, you can instrument your application once and then add or change vendors without changing the instrumentation, for example, many open source tracing tools already support OpenTelemetry.
OpenTelemetry is available for most programming languages and provides interoperability across different languages and environments.
What is OpenTelemetry Collector?
OpenTelemetry Collector is a proxy service between your application and a distributed tracing tool. Collector receives telemetry data, transforms the data, and then exports it to tracing tools that can store the data permanently.
Collector can also work as an agent that pulls telemetry data from monitored programs and then exports it to the configured backends.
See OpenTelemetry Collector for details.
Uptrace
Uptrace is an open source APM for OpenTelemetry with an intuitive query builder, rich dashboards, automatic alerts, and integrations for most languages and frameworks.
You can get started with Uptrace by downloading a DEB/RPM package or a pre-compiled Go binary.
OpenTelemetry Redis receiver
To start monitoring Redis with Otel Collector, you need to configure Redis receiver in /etc/otel-contrib-collector/config.yaml
using Uptrace DSN:
receivers:
otlp:
protocols:
grpc:
http:
redis:
endpoint: localhost:6379
collection_interval: 10s
exporters:
otlp:
endpoint: otlp.uptrace.dev:4317
headers: { 'uptrace-dsn': '<FIXME>' }
processors:
resourcedetection:
detectors: [system]
batch:
timeout: 10s
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp]
metrics:
receivers: [otlp, redis]
processors: [batch, resourcedetection]
exporters: [otlp]
Don't forget to restart the service:
sudo systemctl restart otelcol-contrib
You can also check OpenTelemetry Collector logs for any errors:
sudo journalctl -u otelcol-contrib -f
Available metrics
When telemetry data reaches Uptrace, it automatically generates a Redis dashboard from a pre-defined template.
Prometheus
You can also send OpenTelemetry metrics to Prometheus using OpenTelemetry Prometheus exporter.
What's next?
Next, you can learn more about configuring OpenTelemetry Collector and check available receivers.
To start using OpenTelemetry and Uptrace, see Getting started with Uptrace.