-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Last version of Lumigo Opentelemetry 1.0.118, the Redis instrumentation breaks Redis ZADD functionality
Exact placeumigo_opentelemetry/instrumentations/redis/__init__.p:
fix: update opentelemetry dependencies to patch security vulnerability
# when this hook is called, but only includes the command name for some
# versions so we need to set it ourselves.
add_body_attribute(span, " ".join(args), "db.statement")Expected behavior
When calling the redis client zadd operation with multiple values like this:
redis_client.zadd("zset", {"One": 10, "Two": 20, "Three": 30})it should add all values into the ZSet.
Actual result
The operation fails with next error:
args = ('ZADD', 'zset', 10, 'One', 20, 'Two', ...), kwargs = {}
def request_hook(
span: Span, instance: Connection, args: List[Any], kwargs: Dict[Any, Any]
) -> None:
# a db.statement attribute is automatically added by the RedisInstrumentor
# when this hook is called, but only includes the command name for some
# versions so we need to set it ourselves.
> add_body_attribute(span, " ".join(args), "db.statement")
E TypeError: sequence item 2: expected str instance, int found
/usr/local/lib/python3.7/site-packages/lumigo_opentelemetry/instrumentations/redis/__init__.py:28: TypeError
Workaround
To downgrade to version 1.0.117
Potential solution
Revert to using json.dumps(args) or split into two parts:
- redis command which usually comes first
- redis command attributes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels