opentelemetry-instrumentation-active_record 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50f658b4236dcb93041eb87657f747294a736486d5a5c5627331ea97ef5e00f4
4
- data.tar.gz: 75225a5d5c39035ff0f790ecd92f953e40ba201ccd6d4607f879c5745a6a0065
3
+ metadata.gz: a55434976a5ba204e32e46913ee4ab5a7653060e18fb22b87b28cd2551d4b8f2
4
+ data.tar.gz: 71fc97b9d03c4952c2fb6e2325158aa0f4045c1c3766f60058927d5f251d090c
5
5
  SHA512:
6
- metadata.gz: c09e3a92213cf79097e540242d7db25e20e2c52de9a594f78acfb595362fe1b842503f00082a404a870c411f10816235a870c975f7c8b1e26667ffa2c238bc82
7
- data.tar.gz: 6b3be0fbd88f9bc40286927b346e872fa9a8ffbc02b984bffcebbefff800ce05dd8ab6457ca49035e1e8049859ad301cf96f8a248c08f4d98885777961321798
6
+ metadata.gz: 7d88fe43aba0a4887b95e1fe5600fcc365222597e539f0bfca8ea21206f0480558bec5e3f398719e7142e6d2e4b6770e7a89ead4acbda3a19280173f89f186cf
7
+ data.tar.gz: f00e3bf14b7b1b84d4d25e0cc4707366078cf0bccb0400e268b0864c69f4983ef654890167ebc376999afdaf3f88565a1376ecb8eff80c4b36059e2eea1a74f6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Release History: opentelemetry-instrumentation-active_record
2
2
 
3
+ ### v0.2.0 / 2021-09-29
4
+
5
+ * ADDED: Trace update_all and delete_all calls in ActiveRecord
6
+ * FIXED: Remove Active Record instantiation patch
7
+
3
8
  ### v0.1.1 / 2021-08-12
4
9
 
5
10
  * (No significant changes)
@@ -50,6 +50,8 @@ module OpenTelemetry
50
50
  ::ActiveRecord::Base.prepend(Patches::PersistenceInsertClassMethods) if insert_class_methods_supported?
51
51
  ::ActiveRecord::Base.prepend(Patches::TransactionsClassMethods)
52
52
  ::ActiveRecord::Base.prepend(Patches::Validations)
53
+
54
+ ::ActiveRecord::Relation.prepend(Patches::RelationPersistence)
53
55
  end
54
56
 
55
57
  def require_dependencies
@@ -59,6 +61,7 @@ module OpenTelemetry
59
61
  require_relative 'patches/persistence_insert_class_methods' if insert_class_methods_supported?
60
62
  require_relative 'patches/transactions_class_methods'
61
63
  require_relative 'patches/validations'
64
+ require_relative 'patches/relation_persistence'
62
65
  end
63
66
  end
64
67
  end
@@ -30,12 +30,6 @@ module OpenTelemetry
30
30
  end
31
31
  end
32
32
 
33
- def instantiate(attributes, column_types = {}, &block)
34
- tracer.in_span("#{self}.instantiate") do
35
- super
36
- end
37
- end
38
-
39
33
  def update(id = :all, attributes) # rubocop:disable Style/OptionalArguments
40
34
  tracer.in_span("#{self}.update") do
41
35
  super
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright The OpenTelemetry Authors
4
+ #
5
+ # SPDX-License-Identifier: Apache-2.0
6
+
7
+ module OpenTelemetry
8
+ module Instrumentation
9
+ module ActiveRecord
10
+ module Patches
11
+ # Module to prepend to ActiveRecord::Relation for instrumentation
12
+ module RelationPersistence
13
+ def update_all(*)
14
+ tracer.in_span("#{model.name}.update_all") do
15
+ super
16
+ end
17
+ end
18
+
19
+ def delete_all(*)
20
+ tracer.in_span("#{model.name}.delete_all") do
21
+ super
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def tracer
28
+ ActiveRecord::Instrumentation.instance.tracer
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module ActiveRecord
10
- VERSION = '0.1.1'
10
+ VERSION = '0.2.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-16 00:00:00.000000000 Z
11
+ date: 2021-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -211,6 +211,7 @@ files:
211
211
  - lib/opentelemetry/instrumentation/active_record/patches/persistence_class_methods.rb
212
212
  - lib/opentelemetry/instrumentation/active_record/patches/persistence_insert_class_methods.rb
213
213
  - lib/opentelemetry/instrumentation/active_record/patches/querying.rb
214
+ - lib/opentelemetry/instrumentation/active_record/patches/relation_persistence.rb
214
215
  - lib/opentelemetry/instrumentation/active_record/patches/transactions_class_methods.rb
215
216
  - lib/opentelemetry/instrumentation/active_record/patches/validations.rb
216
217
  - lib/opentelemetry/instrumentation/active_record/version.rb
@@ -218,10 +219,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
218
219
  licenses:
219
220
  - Apache-2.0
220
221
  metadata:
221
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-active_record/v0.1.1/file.CHANGELOG.html
222
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-active_record/v0.2.0/file.CHANGELOG.html
222
223
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/active_record
223
224
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
224
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-active_record/v0.1.1
225
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-active_record/v0.2.0
225
226
  post_install_message:
226
227
  rdoc_options: []
227
228
  require_paths: