dd-trace-rb icon indicating copy to clipboard operation
dd-trace-rb copied to clipboard

Redis command_args end up in APM despite being disabled

Open farnoy opened this issue 1 year ago • 4 comments

Current behaviour Command arguments are submitted in the span, despite this setting being disabled.

Expected behaviour I wanted to just see commands like GET, SET without arguments.

Steps to reproduce

  1. Instrument Redis
  2. Use Rails.cache
  3. Observe cache keys as arguments to the GET command

Environment

  • datadog version: 1.23 but this instrumentation hasn't changed through 2.8
  • Configuration block (Datadog.configure ...):
c.tracing.instrument :redis,
                      describes: { url: redis_url },
                      service_name: "#{service_base_name}-redis"
  • Ruby version: 3.3.6
  • Operating system: linux x64
  • Relevant library versions:
     ddtrace (1.23.3)
       datadog-ci (~> 0.8.1)
       debase-ruby_core_source (= 3.3.1)
       libdatadog (~> 7.0.0.1.0)
       libddwaf (~> 1.14.0.0.0)
       msgpack

farnoy avatar Dec 16 '24 11:12 farnoy

Oh and I did verify that it gets disabled properly:

        :command_args=>
          #<Datadog::Core::Configuration::Option:0x00007fb9804235d8
           @context=#<Datadog::Tracing::Contrib::Redis::Configuration::Settings:0x00007fb98a865fb0 ...>,
           @definition=
            #<Datadog::Core::Configuration::OptionDefinition:0x00007fb9948b9430
             @after_set=nil,
             @default=false,
             @default_proc=nil,
             @deprecated_env=nil,
             @env="DD_REDIS_COMMAND_ARGS",
             @env_parser=nil,
             @name=:command_args,
             @resetter=nil,
             @setter=
              #<Proc:0x00007fb993e7ab68 /app/vendor/bundle/ruby/3.3.0/gems/ddtrace-1.23.3/lib/datadog/core/configuration/opt
ion_definition.rb:10 (lambda)>,
             @type=:bool,
             @type_options={:nilable=>false}>,
           @is_set=true,
           @precedence_set=#<struct Datadog::Core::Configuration::Option::Precedence::Value numeric=
1, name=:programmatic>,
           @value=false,
           @value_per_precedence=
            {#<struct Datadog::Core::Configuration::Option::Precedence::Value numeric=1, name=
:programmatic>=>false}>,

farnoy avatar Dec 16 '24 11:12 farnoy

Hi @farnoy!

Thanks for reporting this (and sorry for the late reply.) I will raise this with the team, have someone take a look.

delner avatar Jan 06 '25 09:01 delner

Hello @farnoy! I'm taking a look at the issue and just wanted to get some more information. Where are the command arguments showing up in the span? Is it the resource name or span tags or somewhere else? Based on that we can take a deeper look at the code and see what's going on here.

Thanks!

zarirhamza avatar Jan 07 '25 15:01 zarirhamza

Hi @zarirhamza,

I'm not sure about the terminology, it's as if it was a tag called db.statement but it isn't displayed in the Span Attributes section. So either it's a real tag and the UI is moving it around, or it's something else?

Image

farnoy avatar Jan 17 '25 15:01 farnoy