diff --git a/helpers/mysql/lib/opentelemetry/helpers/mysql.rb b/helpers/mysql/lib/opentelemetry/helpers/mysql.rb index f1432bfc5..1813f3e09 100644 --- a/helpers/mysql/lib/opentelemetry/helpers/mysql.rb +++ b/helpers/mysql/lib/opentelemetry/helpers/mysql.rb @@ -39,7 +39,7 @@ class MySQL # Ignore query names that might appear in comments prepended to the # statement. - PREPENDED_COMMENTS_REGEX = %r{/\*(?:[^/]|/[^*])*?(?:\*/|/\*.*)}m + PREPENDED_COMMENTS_REGEX = %r{(?:\/\*.*?\*\/)}m QUERY_NAME_REGEX = Regexp.new("^\s*(?:#{PREPENDED_COMMENTS_REGEX})?\s*\\b(#{QUERY_NAMES.join('|')})\\b.*", Regexp::IGNORECASE) # This is a span naming utility intended for use in MySQL database