Skip to content

Make query in FT.SEARCH human readable #3204

Open
@nikolaydubina

Description

@nikolaydubina

Command args printer (as seen in otel db.statement) is obscure. even when queries are simple and human readable. this leads to problems with debugging.

Expected Behavior

query should be printed like *=>[KNN 10 @v $v

as produced by:

image

Current Behavior

image

Possible Solution

probably this code makes printing query into non-simple bytes (due to lack of whitespace or other symbols)

https://github.com/redis/go-redis/blob/master/extra/rediscmd/rediscmd.go#L13

Steps to Reproduce

  1. make any simple query with FT.SEARCH
  2. observe otel db.statement

Context (Environment)

go redis module

github.com/redis/go-redis/v9 v9.7.0
github.com/redis/go-redis/extra/redisotel/v9 v9.7.0

Detailed Description

If otel db.statement is indeed shows exactly what is send over wire, maybe it is okay to keep it. but I doubt so. since this is conflicting with Redis syntax in docs.

importantly, Redis was designed to have API human readable. specifically query statements. now we are marshalling what is supposed to be human redable into non-readable binary? how come? when did we lose the plot?

Possible Implementation

  1. review what is send on wire (if command is human readble indeed)
  2. set otel to what is send on wire

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions