You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spans from redis instrumentation don't contain a lot of attributes, such as "db.system", "net.transport" and so on. It happens because RedisCluster instance doesn't have connection_pool attribute.
Describe your environment
Ubuntu 22.04
Python 3.10.13
fromopentelemetry.instrumentation.redisimport (
RedisInstrumentor,
_set_connection_attributes,
)
def_redis_request_hook(span, conn, args, kwargs):
ifhasattr(conn, "connection_pool") ornotspan.is_recording():
returnifhasattr(conn, "nodes_manager"): # means we're working with RedisCluster_set_connection_attributes(
span, conn.nodes_manager.default_node.redis_connection
)
RedisInstrumentor().instrument(request_hook=_redis_request_hook)
edit: actually you should use the response_hook. Otherwise commands that use a ClusterPipeline (like set_many) will still have missing attributes since the ClusterPipeline.execute_command wrapper doesn't call request_hook.
Spans from redis instrumentation don't contain a lot of attributes, such as "db.system", "net.transport" and so on. It happens because RedisCluster instance doesn't have connection_pool attribute.
Describe your environment
Ubuntu 22.04
Python 3.10.13
Packages:
Steps to reproduce
main.py
file:docker-compose.yaml
for Redis Cluster:Run Redis Cluster:
Run
main.py
:What is the expected behavior?
There are "db.system" and other attributes in span.
What is the actual behavior?
The text was updated successfully, but these errors were encountered: