lib/opentelemetry/instrumentation/dalli/utils.rb in opentelemetry-instrumentation-dalli-0.15.0 vs lib/opentelemetry/instrumentation/dalli/utils.rb in opentelemetry-instrumentation-dalli-0.16.0

- old
+ new

@@ -46,17 +46,13 @@ def format_command(operation, args) placeholder = "#{operation} BLOB (OMITTED)" command = [operation, *args].join(' ').strip command = OpenTelemetry::Common::Utilities.utf8_encode(command, binary: true, placeholder: placeholder) - truncate(command, CMD_MAX_LEN) + OpenTelemetry::Common::Utilities.truncate(command, CMD_MAX_LEN) rescue StandardError => e OpenTelemetry.logger.debug("Error sanitizing Dalli operation: #{e}") placeholder - end - - def truncate(string, size) - string.size > size ? "#{string[0...size - 3]}..." : string end end end end