OpenTelemetry Redis Instrumentation

Instrument redis to report Redis queries.

There are two options for instrumenting code. The first option is to use the opentelemetry-instrumentation executable which will automatically instrument your Redis client. The second is to programmatically enable instrumentation via the following code:

Usage

from opentelemetry.instrumentation.redis import RedisInstrumentor
import redis


# Instrument redis
RedisInstrumentor().instrument()

# This will report a span with the default settings
client = redis.StrictRedis(host="localhost", port=6379)
client.get("my-key")

API

class opentelemetry.instrumentation.redis.RedisInstrumentor(*args, **kwargs)[source]

Bases: opentelemetry.instrumentation.instrumentor.BaseInstrumentor

An instrumentor for Redis See BaseInstrumentor