Skip to content

pmeier/opentelemetry-python-contrib-external-valkey

Repository files navigation

opentelemetry-python-contrib-external-valkey

OpenTelemetry instrumentation for the Valkey Python Client.

How do I install it?

opentelemetry-python-contrib-external-valkey is available on PyPI. You can install it with

pip install opentelemetry-python-contrib-external-valkey

or

uv add opentelemetry-python-contrib-external-valkey

or something equivalent.

How do I use it?

For global instrumentation of the Valkey Python client you can do

from opentelemetry.instrumentation.valkey import ValkeyInstrumentor

ValkeyInstrumentor().instrument()

For more detailed documentation please have a look at the opentelemetry-instrumentation-redis documentation and just replace [rR]edis with [vV]alkey.

Why is this needed?

opentelemetry-instrumentation-redis instruments the redis module and has multiple isinstance checks for classes from it. Since the [Valkey Python Client] is a fork of the Redis Python Client, any instrumentation through opentelemetry-instrumentation-redis has no effect on the valkey module or any of its classes. opentelemetry-python-contrib-external-valkey fills this gap until Valkey is officially supported and gives Valkey users the same user experience for instrumentation as Redis users.

How does it work?

This repository is a fork of opentelemetry-python-contrib and specifically the instrumentation/opentelemetry-instrumentation-redis folder. 95% and more of the changes in the src and tests folders are just replacing the strings redis and Redis with valkey and Valkey respectively.

About

OpenTelemetry Valkey instrumentation

Topics

Resources

License

Stars

Watchers

Forks

Languages