Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis logs command arguments even when not configured to do so. #10226

Open
hberntsen opened this issue Aug 14, 2024 · 1 comment
Open

Redis logs command arguments even when not configured to do so. #10226

hberntsen opened this issue Aug 14, 2024 · 1 comment

Comments

@hberntsen
Copy link

Summary of problem

The redis integration does not filter parameters of the executed commands.

Which version of dd-trace-py are you using?

2.10.4

Which version of pip are you using?

pip 24.1.2

Which libraries and their versions are you using?

redis 4.6.0

How can we reproduce your problem?

Execute the set redis command asynchronously in Python using the redis library. For example:

await redis_client.set(
    key,
    json.dumps(value, default=str),
    ex=timedelta(weeks=1),
)

We also see this with other Redis commands.

What is the result that you get?

With the sample code above but also for other commands we see pattens like SET the-key-we-used ? json-dump. Where the-key-we-used represents the contents of the key variable and json-dump the json.dumps output. These are logged to APM spans in the db.statement tag.

What is the result that you expected?

For databases like MySQL or Elasticsearch, dd-trace-py strips information and replaces it with a ?. It does not do this for redis by default. We did not configure resource_only_command for Redis. The description of that configuration option states:

The span resource will only include the command executed. To include all arguments in the span resource, set this value to False.

This option can also be set with the DD_REDIS_RESOURCE_ONLY_COMMAND environment variable.

Default: True

I would expect this to only log the Redis command, i.e. SET. In our case we still see all the arguments and we don't want that.

@emmettbutler
Copy link
Collaborator

Thanks for reporting this, @hberntsen. As far as I can tell, this is missing functionality as opposed to broken funcitonality. The DD_REDIS_RESOURCE_ONLY_COMMAND is intended to only affect the span.resource attribute.

cc @mabdinur @wconti27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants