Class: Honeycomb::Redis::Fields
- Inherits:
-
Object
- Object
- Honeycomb::Redis::Fields
- Defined in:
- lib/honeycomb/integrations/redis.rb
Overview
This structure contains the fields we’ll add to each Redis span.
The logic is in this class to avoid monkey-patching extraneous APIs into the Redis::Client via Client.
Instance Method Summary collapse
- #command=(commands) ⇒ Object
-
#initialize(client) ⇒ Fields
constructor
A new instance of Fields.
- #options=(options) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
permalink #initialize(client) ⇒ Fields
Returns a new instance of Fields.
125 126 127 |
# File 'lib/honeycomb/integrations/redis.rb', line 125 def initialize(client) @client = client end |
Instance Method Details
permalink #command=(commands) ⇒ Object
[View source]
135 136 137 138 |
# File 'lib/honeycomb/integrations/redis.rb', line 135 def command=(commands) commands = Array(commands) values["redis.command"] = commands.map { |cmd| format(cmd) }.join("\n") end |
permalink #options=(options) ⇒ Object
[View source]
129 130 131 132 133 |
# File 'lib/honeycomb/integrations/redis.rb', line 129 def () .each do |option, value| values["redis.#{option}"] ||= value unless ignore?(option) end end |
permalink #to_hash ⇒ Object
[View source]
140 141 142 |
# File 'lib/honeycomb/integrations/redis.rb', line 140 def to_hash values end |