diff --git a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb index a0e59d403..11695dca2 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 4ab9db7d0..2e20349dd 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 SQL =~ 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 c383249c5..e70c8427e 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