diff --git a/lib/ddtrace/contrib/rails/utils.rb b/lib/ddtrace/contrib/rails/utils.rb index ebd2518263b..16789e422b1 100644 --- a/lib/ddtrace/contrib/rails/utils.rb +++ b/lib/ddtrace/contrib/rails/utils.rb @@ -26,7 +26,9 @@ def self.normalize_template_name(name) end def self.app_name - if ::Rails::VERSION::MAJOR >= 4 + if ::Rails::VERSION::MAJOR >= 6 + ::Rails.application.class.module_parent_name.underscore + elsif ::Rails::VERSION::MAJOR >= 4 ::Rails.application.class.parent_name.underscore else ::Rails.application.class.to_s.underscore