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 Gem 5.x Support #953

Open
arielvalentin opened this issue Apr 27, 2024 · 4 comments
Open

Redis Gem 5.x Support #953

arielvalentin opened this issue Apr 27, 2024 · 4 comments
Labels
help wanted Extra attention is needed instrumentation keep Ensures stale-bot keeps this issue/PR open

Comments

@arielvalentin
Copy link
Collaborator

The instrumentation only supports the Redis 4.x.

https://github.com/open-telemetry/opentelemetry-ruby-contrib/actions/runs/8863073727/job/24336701986?pr=951

1) Failure:
  OpenTelemetry::Instrumentation::Redis::Patches::RedisV4Client::#process::when db_statement is :omit#test_0001_omits db.statement attribute [test/opentelemetry/instrumentation/redis/patches/client_test.rb:300]:
  Expected: "AUTH"
    Actual: "PIPELINED"
  
    2) Error:
  OpenTelemetry::Instrumentation::Redis::Middlewares::RedisClientInstrumentation::#process#test_0009_records net.peer.name and net.peer.port attributes:
  NoMethodError: undefined method `name' for nil
      test/opentelemetry/instrumentation/redis_client_test.rb:163:in `block (3 levels) in <top (required)>'
  
    3) Failure:
  OpenTelemetry::Instrumentation::Redis::Middlewares::RedisClientInstrumentation::#process#test_0004_after authorization with Redis server [test/opentelemetry/instrumentation/redis_client_test.rb:70]:
  Expected: "AUTH ?"
    Actual: "AUTH passw0rd"
  
    4) Failure:
  OpenTelemetry::Instrumentation::Redis::Patches::RedisV4Client::#process#test_0008_records exceptions [test/opentelemetry/instrumentation/redis/patches/client_test.rb:153]:
  Expected "Unhandled exception of type: RedisClient::CommandError" to include "ERR unknown command 'THIS_IS_NOT_A_REDIS_FUNC', with args beginning with: 'THIS_IS_NOT_A_VALID_ARG".
  
    5) Error:
  OpenTelemetry::Instrumentation::Redis::Patches::RedisV4Client::#process#test_0015_truncates long db.statements:
  Redis::CommandError: ERR unknown command `queue`, with args beginning with: `set`, `v1`, `yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy`, (redis://localhost:6379)
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client/connection_mixin.rb:36:in `call'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client.rb:294:in `block (2 levels) in call_v'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client/middlewares.rb:16:in `call'
      lib/opentelemetry/instrumentation/redis/middlewares/redis_client.rb:25:in `block in call'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/opentelemetry-api-1.2.5/lib/opentelemetry/trace/tracer.rb:37:in `block in in_span'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/opentelemetry-api-1.2.5/lib/opentelemetry/trace.rb:70:in `block in with_span'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/opentelemetry-api-1.2.5/lib/opentelemetry/context.rb:87:in `with_value'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/opentelemetry-api-1.2.5/lib/opentelemetry/trace.rb:70:in `with_span'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/opentelemetry-api-1.2.5/lib/opentelemetry/trace/tracer.rb:37:in `in_span'
      lib/opentelemetry/instrumentation/redis/middlewares/redis_client.rb:24:in `call'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client.rb:293:in `block in call_v'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client.rb:699:in `ensure_connected'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client.rb:292:in `call_v'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-5.2.0/lib/redis/client.rb:90:in `call_v'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-5.2.0/lib/redis.rb:152:in `block in send_command'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-5.2.0/lib/redis.rb:[151](https://github.com/open-telemetry/opentelemetry-ruby-contrib/actions/runs/8862991669/job/24336536178#step:4:161):in `synchronize'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-5.2.0/lib/redis.rb:151:in `send_command'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-5.2.0/lib/redis/commands.rb:234:in `method_missing'
      test/opentelemetry/instrumentation/redis/patches/client_test.rb:228:in `block (3 levels) in <top (required)>'
  
    6) Error:
  OpenTelemetry::Instrumentation::Redis::Patches::RedisV4Client::#process#test_0011_traces pipelined commands on commit:
  Redis::CommandError: ERR unknown command `queue`, with args beginning with: `set`, `v1`, `0`, (redis://localhost:6379)
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client/connection_mixin.rb:36:in `call'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client.rb:294:in `block (2 levels) in call_v'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client/middlewares.rb:16:in `call'
      lib/opentelemetry/instrumentation/redis/middlewares/redis_client.rb:25:in `block in call'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/opentelemetry-api-1.2.5/lib/opentelemetry/trace/tracer.rb:37:in `block in in_span'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/opentelemetry-api-1.2.5/lib/opentelemetry/trace.rb:70:in `block in with_span'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/opentelemetry-api-1.2.5/lib/opentelemetry/context.rb:87:in `with_value'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/opentelemetry-api-1.2.5/lib/opentelemetry/trace.rb:70:in `with_span'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/opentelemetry-api-1.2.5/lib/opentelemetry/trace/tracer.rb:37:in `in_span'
      lib/opentelemetry/instrumentation/redis/middlewares/redis_client.rb:24:in `call'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client.rb:293:in `block in call_v'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client.rb:699:in `ensure_connected'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-client-0.22.1/lib/redis_client.rb:292:in `call_v'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-5.2.0/lib/redis/client.rb:90:in `call_v'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-5.2.0/lib/redis.rb:[152](https://github.com/open-telemetry/opentelemetry-ruby-contrib/actions/runs/8862991669/job/24336536178#step:4:162):in `block in send_command'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-5.2.0/lib/redis.rb:151:in `synchronize'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-5.2.0/lib/redis.rb:151:in `send_command'
      /opt/hostedtoolcache/Ruby/3.3.0/x64/lib/ruby/gems/3.3.0/gems/redis-5.2.0/lib/redis/commands.rb:234:in `method_missing'
      test/opentelemetry/instrumentation/redis/patches/client_test.rb:188:in `block (3 levels) in <top (required)>'
  
    7) Failure:
  OpenTelemetry::Instrumentation::Redis::Patches::RedisV4Client::#process#test_0006_reflects db index [test/opentelemetry/instrumentation/redis/patches/client_test.rb:101]:
  Expected: 3
    Actual: 2
  
    8) Error:
  OpenTelemetry::Instrumentation::Redis::Patches::RedisV4Client::#process#test_0009_records net.peer.name and net.peer.port attributes:
  NoMethodError: undefined method `name' for nil
      test/opentelemetry/instrumentation/redis/patches/client_test.rb:[163](https://github.com/open-telemetry/opentelemetry-ruby-contrib/actions/runs/8862991669/job/24336536178#step:4:173):in `block (3 levels) in <top (required)>'
  
    9) Failure:
  OpenTelemetry::Instrumentation::Redis::Patches::RedisV4Client::#process#test_0004_after authorization with Redis server [test/opentelemetry/instrumentation/redis/patches/client_test.rb:70]:
  Expected: "AUTH ?"
    Actual: "AUTH passw0rd"
  
   10) Failure:
  OpenTelemetry::Instrumentation::Redis::Patches::RedisV4Client::#process::when db_statement is :obfuscate#test_0001_obfuscates arguments in db.statement [test/opentelemetry/instrumentation/redis/patches/client_test.rb:329]:
  Expected: "AUTH"
    Actual: "PIPELINED"
  
  50 runs, 178 assertions, 6 failures, 4 errors, 0 skips
  rake aborted!
  Command failed with status (1)
  /opt/hostedtoolcache/Ruby/3.3.0/x64/bin/bundle:25:in `load'
  /opt/hostedtoolcache/Ruby/3.3.0/x64/bin/bundle:25:in `<main>'
  Tasks: TOP => test
  (See full trace by running task with --trace)
@arielvalentin arielvalentin added help wanted Extra attention is needed instrumentation labels Apr 28, 2024
@kaylareopelle
Copy link
Contributor

Next step: Release a bounded version of the gem to not install the instrumentation on Redis 5 as a bugfix bump
After: Add support for Redis 5

@kaylareopelle
Copy link
Contributor

Here's the main PR that introduced Redis 5.x support in the New Relic Ruby agent: newrelic/newrelic-ruby-agent#1611

@kaylareopelle
Copy link
Contributor

kaylareopelle commented May 1, 2024

It looks like some work has already taken place to support Redis 5: #121

I don't think the OpenTelemetry::Instrumentation::Redis::Patches::RedisV4Client tests should be running on a Redis 5.x appraisal. However, the two failures from OpenTelemetry::Instrumentation::Redis::Middlewares::RedisClientInstrumentation should be passing.

Copy link
Contributor

github-actions bot commented Jun 1, 2024

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

@github-actions github-actions bot added the stale Marks an issue/PR stale label Jun 1, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2024
@kaylareopelle kaylareopelle added keep Ensures stale-bot keeps this issue/PR open and removed stale Marks an issue/PR stale labels Jul 1, 2024
@kaylareopelle kaylareopelle reopened this Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed instrumentation keep Ensures stale-bot keeps this issue/PR open
Projects
None yet
Development

No branches or pull requests

2 participants