OpenTelemetry Instrumentation for Redis

Automatic distributed tracing for Python's redis client, including async and sync APIs

Library
PyPI
v0.65b0
1,088stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
97/100Excellent
Development Activity100
Maintenance100
Community88
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
77/100Good
Architecture80
Code Quality84
Innovation70
Learning Curve74

opentelemetry-instrumentation-redis automatically instruments the redis Python client so every Redis command (GET, SET, pipelines, pub/sub) creates an OpenTelemetry span, with no changes needed at the call site. It supports both the synchronous redis.StrictRedis client and the async redis.asyncio.Redis client via one RedisInstrumentor().instrument() call, or per-client instrumentation via instrument_client().

Spans include Redis semantic-convention attributes such as the database system, command name, and (optionally) the command arguments, and support request/response hooks for adding custom span attributes around each Redis call.

What You Get

  • A RedisInstrumentor that instruments all Redis client instances with one .instrument() call
  • Support for both sync (redis.StrictRedis) and async (redis.asyncio.Redis) clients
  • Per-client instrumentation via instrument_client() for selective tracing
  • Redis semantic-convention span attributes (db system, command name, and optionally command arguments)
  • Request/response hook support for adding custom span attributes around each command

Common Use Cases

  • Tracing cache reads/writes in a service that uses Redis as an application cache
  • Correlating Redis command latency with the rest of a request’s distributed trace
  • Debugging slow or failing Redis pipelines and pub/sub operations with span-level detail
  • Auditing Redis command patterns in a service for capacity planning or query optimization

Under The Hood

Architecture — the instrumentor subclasses BaseInstrumentor and wraps the command-execution entry points of both redis.StrictRedis and redis.asyncio.Redis (src/opentelemetry/instrumentation/redis/__init__.py, ~810 lines) so every command dispatched through either client creates a span with database semantic-convention attributes, restoring the original methods on _uninstrument(); a separate instrument_client() path allows instrumenting one client instance rather than patching the client classes globally. Tech Stack — pure Python, depending on opentelemetry-api, opentelemetry-instrumentation, and opentelemetry-semantic-conventions from the same monorepo plus redis as the instrumented target; built with hatchling and versioned in lockstep with the rest of the contrib release train. Code Quality — covered by a single but extensive test_redis.py file (1,751 lines) exercising sync and async clients, pipelines, and hook behavior, reflecting the breadth of the Redis command surface being instrumented. API DesignRedisInstrumentor().instrument() covers the common case in one line for both sync and async clients, while instrument_client() and request/response hooks give finer-grained control without requiring a different instrumentor per client type.

Used by 7 apps in this directory

Python
68%
Other

Baserow

No Code Platforms · Databases

5,635

Open-source no-code platform to build databases, apps, automations, and AI agents — self-hosted or cloud, with full data ownership.

View details
89
Repo Health
84
Technical
68
Dependency
Built with
Python68%
JavaScript15%
Vue12%
Updated today
TypeScript
50%
Other

Dify

No Code Platforms · AI Development · Developer Tools

152,883

Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.

View details
92
Repo Health
85
Technical
71
Dependency
Built with
TypeScript50%
Python47%
Updated today
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,367

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
69
Repo Health
78
Technical
66
Dependency
Built with
TypeScript71%
Go16%
Updated yesterday
Python
37%
Other

Open WebUI

AI Assistants · AI Agents

149,204

The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.

View details
91
Repo Health
75
Technical
66
Dependency
Built with
Python37%
Svelte33%
JavaScript22%
Updated today
Python
55%
Other

PostHog

Analytics · Monitoring · Developer Tools

37,777

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
67
Dependency
Built with
Python55%
TypeScript36%
Updated today
Python
69%
Apache 2.0

SurfSense

Search · AI Assistants

15,960

The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.

View details
88
Repo Health
71
Technical
66
Dependency
Built with
Python69%
TypeScript28%
Updated today
Python
91%
GPL 3.0

Weblate

Developer Tools

6,028

Continuous localization platform that commits translations directly into your version control system with full translator attribution.

View details
95
Repo Health
86
Technical
74
Dependency
Built with
Python91%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search