Skip to content

Commit

Permalink
feat(sidekiq): Don't record redis-url if url can't be safely extracte…
Browse files Browse the repository at this point in the history
…d from client

Signed-off-by: Ferenc Géczi <[email protected]>
  • Loading branch information
Ferenc- committed Dec 7, 2023
1 parent 195996c commit 5ebf813
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/instana/instrumentation/sidekiq-client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def call(worker_class, msg, queue, _redis_pool)
[client.connection[:host], client.connection[:port]]
elsif client.respond_to?(:client) && client.client.respond_to?(:options)
[client.client.options[:host], client.client.options[:port]]
else
['Unknown', 'Unknown']
else # Unexpected version, continue without recording any redis-url
break
end
kv_payload[:'sidekiq-client'][:'redis-url'] = "#{host}:#{port}"
end
Expand Down
4 changes: 2 additions & 2 deletions lib/instana/instrumentation/sidekiq-worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def call(_worker, msg, _queue)
[client.connection[:host], client.connection[:port]]
elsif client.respond_to?(:client) && client.client.respond_to?(:options)
[client.client.options[:host], client.client.options[:port]]
else
['Unknown', 'Unknown']
else # Unexpected version, continue without recording any redis-url
break
end
kv_payload[:'sidekiq-worker'][:'redis-url'] = "#{host}:#{port}"
end
Expand Down

0 comments on commit 5ebf813

Please sign in to comment.