Module: MongoPatch::CommandSerializer

Defined in:
lib/helios/opentelemetry/sdk/patches/mongo_patch.rb

Instance Method Summary collapse

Instance Method Details

#mask(hash) ⇒ Object

Temp patch until the upstream fix is released



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/helios/opentelemetry/sdk/patches/mongo_patch.rb', line 23

def mask(hash)
  hash.each_with_object({}) do |(k, v), h|
    value = if v.is_a?(Hash)
              mask(v)
            elsif @obfuscate
              '?'
            else
              v
            end
    h[k] = value
  end
end