Description
Introduction:
I used Logfire with Redis and it worked just fine. As far as Redis became proprietary and Valkey (fork of the last open-source Redis version) appeared as and OSS-alternative, more and more providers now provide Valkey as a cheaper Redis or even provide only Valkey.
For now, as I know, Valkey is Redis-compatible, but developers say that someday Valkey will become incompatible anyway. Moreover, Valkey is already developing more actively than Redis.
Just as Redis has redis-py, Valkey has valkey-py, which are (obviously) in-place replacements for Redis<->Valkey. But as I said earlier, this will not last forever.
The problem:
I used redis-py and logfire.instrument_redis() worked just fine. I switched to valkey-py and kept logfire.instrument_redis() as there is no other options. Unluckily, now Logfire doesn't create any spans, just silence in places where redis-py was instrumented correctly. Other things are still instrumenting correctly.
The solution(s):
I guess it's acceptable for now to extend logfire.instrument_redis() to handle Valkey, but probably in future it will be necessary to separate these instrumentations. So, two solutions are possible as for now:
- Extend
logfire.instrument_redis() to handle Valkey (looks like temporary solution)
- Make
logfire.instrument_valkey() which would be almost equal to logfire.instrument_redis() right now
Description
Introduction:
I used Logfire with Redis and it worked just fine. As far as Redis became proprietary and Valkey (fork of the last open-source Redis version) appeared as and OSS-alternative, more and more providers now provide Valkey as a cheaper Redis or even provide only Valkey.
For now, as I know, Valkey is Redis-compatible, but developers say that someday Valkey will become incompatible anyway. Moreover, Valkey is already developing more actively than Redis.
Just as Redis has redis-py, Valkey has valkey-py, which are (obviously) in-place replacements for Redis<->Valkey. But as I said earlier, this will not last forever.
The problem:
I used redis-py and
logfire.instrument_redis()worked just fine. I switched to valkey-py and keptlogfire.instrument_redis()as there is no other options. Unluckily, now Logfire doesn't create any spans, just silence in places where redis-py was instrumented correctly. Other things are still instrumenting correctly.The solution(s):
I guess it's acceptable for now to extend
logfire.instrument_redis()to handle Valkey, but probably in future it will be necessary to separate these instrumentations. So, two solutions are possible as for now:logfire.instrument_redis()to handle Valkey (looks like temporary solution)logfire.instrument_valkey()which would be almost equal tologfire.instrument_redis()right now