module OpenTelemetry::Instrumentation::ActiveRecord::Patches::Validations

Module to prepend to ActiveRecord::Base for instrumentation We patch these methods because they either raise, or call the super implementation in persistence.rb github.com/rails/rails/blob/v5.2.4.5/activerecord/lib/active_record/validations.rb#L42-L53 Contains the ActiveRecord::Validations methods to be patched

Public Instance Methods

save(**options) click to toggle source
Calls superclass method
# File lib/opentelemetry/instrumentation/active_record/patches/validations.rb, line 17
def save(**options)
  tracer.in_span("#{self.class}#save") do
    super
  end
end
save!(**options) click to toggle source
Calls superclass method
# File lib/opentelemetry/instrumentation/active_record/patches/validations.rb, line 23
def save!(**options)
  tracer.in_span("#{self.class}#save!") do
    super
  end
end

Private Instance Methods

tracer() click to toggle source
# File lib/opentelemetry/instrumentation/active_record/patches/validations.rb, line 31
def tracer
  ActiveRecord::Instrumentation.instance.tracer
end