Files
go/example/otel
BigskandGitHub cd984fae99 chore(ring): inline rendezvous hashing and remove external dependency (#3762)
* ring: remove external rendezvous dependency by inlining implementation

Replace usage of github.com/dgryski/go-rendezvous with an internal
implementation to eliminate the external dependency and avoid licence
propagation concerns.

The implementation preserves the exact hashing algorithm and behaviour:
- same hash combination: khash ^ nhash
- same mixing function (xorshift* variant)
- same node ordering semantics

No functional changes intended.

* Refactor TestRendezvous to remove randomString function

Replaced function with inline string generation for test cases.

* test: refactor RendezvousHash tests to use Ginkgo and Gomega

* test: improve RendezvousHash test for per-instance determinism and distribution balance

* test: enhance distribution verification in RendezvousHash tests
2026-04-07 10:26:18 +03:00
..

go-redis OpenTelemetry Monitoring with Uptrace

This example demonstrates how to instrument and monitor Redis operations in Go applications using OpenTelemetry and Uptrace, providing comprehensive observability into your Redis performance and operations.

Overview

This integration provides:

  • Distributed tracing for Redis operations
  • Performance monitoring with latency and throughput metrics
  • Error tracking and debugging capabilities
  • Visual dashboards for Redis health monitoring
  • Production-ready observability stack with Docker

Prerequisites

  • Go 1.19+
  • Docker and Docker Compose
  • Basic understanding of Redis and OpenTelemetry

Quick Start

1. Clone and Navigate

git clone https://github.com/redis/go-redis.git
cd example/otel

2. Start the Monitoring Stack

Launch Redis and Uptrace services:

docker compose up -d

This starts:

  • Redis server on localhost:6379
  • Uptrace APM on http://localhost:14318

3. Verify Services

Check that Uptrace is running properly:

docker compose logs uptrace

Look for successful startup messages without errors.

4. Run the Example

Execute the instrumented Redis client:

go run client.go

You should see output similar to:

trace: http://localhost:14318/traces/ee029d8782242c8ed38b16d961093b35

Click the trace URL to view detailed operation traces in Uptrace.

Redis trace visualization

5. Explore the Dashboard

Open the Uptrace UI at http://localhost:14318 to explore:

  • Traces: Individual Redis operation details
  • Metrics: Performance statistics and trends
  • Logs: Application and system logs
  • Service Map: Visual representation of dependencies

Advanced Monitoring Setup

Redis Performance Metrics

For production environments, enable comprehensive Redis monitoring by installing the OpenTelemetry Collector:

The OpenTelemetry Collector acts as a telemetry agent that:

  • Pulls performance metrics directly from Redis
  • Collects system-level statistics
  • Forwards data to Uptrace via OTLP protocol

When configured, Uptrace automatically generates a Redis dashboard:

Redis performance dashboard

Key Metrics Monitored

  • Connection Statistics: Active connections, connection pool utilization
  • Command Performance: Operation latency, throughput, error rates
  • Memory Usage: Memory consumption, key distribution
  • Replication Health: Master-slave sync status and lag

Logs and Debugging

View service logs:

# All services
docker compose logs

# Specific service
docker compose logs redis
docker compose logs uptrace

Additional Resources