Sha256: 8e3c9ef906baec0e3d7f6bb9fe911a09da556ba16db43a5354a271a271874945
Contents?: true
Size: 924 Bytes
Versions: 9
Compression:
Stored size: 924 Bytes
Contents
# frozen_string_literal: true # Copyright The OpenTelemetry Authors # # SPDX-License-Identifier: Apache-2.0 module OpenTelemetry module Instrumentation module ActiveRecord module Patches # Module to prepend to ActiveRecord::Base for instrumentation module TransactionsClassMethods def self.prepended(base) class << base prepend ClassMethods end end # Contains ActiveRecord::Transactions::ClassMethods to be patched module ClassMethods def transaction(**options, &block) tracer.in_span('ActiveRecord.transaction', attributes: { 'code.namespace' => name }) do super end end private def tracer ActiveRecord::Instrumentation.instance.tracer end end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems