Skip to content

Valkey instrumentation (probably it's equal to Redis right now) #2083

Description

@EgorBlyablin

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:

  1. Extend logfire.instrument_redis() to handle Valkey (looks like temporary solution)
  2. Make logfire.instrument_valkey() which would be almost equal to logfire.instrument_redis() right now

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions