Monitoring performance and errors

Monitoring go-redis client

You can monitor Redis performance and errors using distributed tracingopen in new window. Tracing allows you to see how a request progresses through different services and systems, timings of every operation, any logs and errors as they occur.

go-redis supports tracing using OpenTelemetry API. OpenTelemetry is a vendor-neutral API for distributed traces and metrics. It specifies how to collect and send telemetry data to backend platforms. It means that you can instrument your application once and then add or change vendors (backends) as required.

go-redis comes with an OpenTelemetry instrumentation called redisotelopen in new window that is distributed as a separate module:

go get

To instrument Redis client, you need to add the hook provided by redisotel:

import (

rdb := redis.NewClient(&redis.Options{...})


For Redis Cluster and Ring you need to instrument each node separately:

rdb := redis.NewClusterClient(&redis.ClusterOptions{
    // ...

    NewClient: func(opt *redis.Options) *redis.Client {
        node := redis.NewClient(opt)
        return node


As expected, redisotel creates spansopen in new window for processed Redis commands and records any errors as they occur. Here is how the collected information is displayed at Uptraceopen in new window:

Redis trace

If you need an example, see GitHubopen in new window.

Monitoring Redis Server

See Monitoring Redis Server with OpenTelemetry Collectoropen in new window.

Get insights and updates in your inbox: