diff --git a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb index 11695dca2..6c68b0d0d 100644 --- a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb +++ b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb @@ -96,7 +96,7 @@ def _otel_client_attributes(sql) end def collection_name(sql) - Regexp.last_match[1] if sql =~ TABLE_NAME + Regexp.last_match(1) if sql =~ TABLE_NAME rescue StandardError nil end diff --git a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/patches/connection.rb b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/patches/connection.rb index 2e20349dd..421a02fd0 100644 --- a/instrumentation/pg/lib/opentelemetry/instrumentation/pg/patches/connection.rb +++ b/instrumentation/pg/lib/opentelemetry/instrumentation/pg/patches/connection.rb @@ -132,7 +132,7 @@ def validated_operation(operation) end def collection_name(text) - Regexp.last_match[1] if text =~ TABLE_NAME + Regexp.last_match(1) if text =~ TABLE_NAME rescue StandardError nil end diff --git a/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb b/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb index e70c8427e..097409958 100644 --- a/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb +++ b/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy/patches/client.rb @@ -95,7 +95,7 @@ def client_attributes(sql = nil) end def collection_name(sql) - Regexp.last_match[1] if sql =~ TABLE_NAME + Regexp.last_match(1) if sql =~ TABLE_NAME rescue StandardError nil end