lib/ddtrace/contrib/redis/quantize.rb in ddtrace-0.11.0.beta2 vs lib/ddtrace/contrib/redis/quantize.rb in ddtrace-0.11.0
- old
+ new
@@ -3,19 +3,19 @@
module Redis
# Quantize contains Redis-specific resource quantization tools.
module Quantize
PLACEHOLDER = '?'.freeze
TOO_LONG_MARK = '...'.freeze
- VALUE_MAX_LEN = 100
- CMD_MAX_LEN = 1000
+ VALUE_MAX_LEN = 50
+ CMD_MAX_LEN = 500
module_function
def format_arg(arg)
str = arg.is_a?(Symbol) ? arg.to_s.upcase : arg.to_s
- str = str.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
+ str = Utils.utf8_encode(str, binary: true, placeholder: PLACEHOLDER)
Utils.truncate(str, VALUE_MAX_LEN, TOO_LONG_MARK)
- rescue StandardError => e
+ rescue => e
Datadog::Tracer.log.debug("non formattable Redis arg #{str}: #{e}")
PLACEHOLDER
end
def format_command_args(command_args)