OpenTelemetry Instrumentation for Redis

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

Library
PyPI
v0.66b0
1,102 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
94 /100 Excellent
Development Activity 96
Maintenance 100
Community 80
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
77 /100 Good
Architecture 80
Code Quality 84
Innovation 70
Learning Curve 74

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 Design — RedisInstrumentor().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

Databases · No Code Platforms

6,012

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
Python 68%
JavaScript 16%
Vue 11%
Updated 1 weeks ago
TypeScript
50%
Other

Dify

AI Development · Design Tools · Developer Tools

157,364

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

View details
92
Repo Health
85
Technical
66
Dependency
Built with
TypeScript 50%
Python 47%
Updated 1 weeks ago
TypeScript
71%
Other

highlight.io

Analytics · Developer Tools · Monitoring

9,378

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
67
Repo Health
78
Technical
65
Dependency
Built with
TypeScript 71%
Go 16%
Updated 1 months ago
Python
37%
Other

Open WebUI

AI Agents · AI Assistants

153,390

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
Python 37%
Svelte 34%
JavaScript 21%
Updated 1 weeks ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

39,975

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
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 1 weeks ago
Python
67%
Apache 2.0

SurfSense

AI Assistants · Search

16,270

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

View details
87
Repo Health
71
Technical
66
Dependency
Built with
Python 67%
TypeScript 30%
Updated 1 weeks ago
Python
91%
GPL 3.0

Weblate

Developer Tools

6,094

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

View details
95
Repo Health
86
Technical
67
Dependency
Built with
Python 91%
Updated 1 weeks ago

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