activerecord-instrumentation 0.5.2 → 0.6.0.jhemphill3

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: 635ba6dbb0a024eb2bae250b6d30493690f4b537fa169da2793738770b5d3a2e
4
- data.tar.gz: f6b6e9d38b4b5f4521dec162ee36bc605bb31747f8a7898e7667fb7009ecac6d
3
+ metadata.gz: 95c186a845e1f54640ec23d41c6f4af63672c70a2b40eead66abd7dfdfa9a5d9
4
+ data.tar.gz: 5dbd6b7b69424ff53fe2aaaecd2c9980ea427f32ac85b69f779b6bd60fbfe1c5
5
5
  SHA512:
6
- metadata.gz: 0cbfa60d7a540c72a4a7505504e933c7d2e6e9f0431f1829e0ec2c9fad6528807ec67a32d0e2a9108b52dc424ab791051fe846057bfec637746acd2791fcfda2
7
- data.tar.gz: 8ca19599f279459af06f90fffa5bc0f9d8f23447352a7a3fb47fe0919c18c729bf5ce41c0cf1eae188632a43e35cac581da603126a7818848189b4c2815eddb5
6
+ metadata.gz: 1542c660df6a46953df85ed993648afcf28b3a5195560176b528d7f03dd148ad404bbe53e732ea8ac4a0fa6f81cc471e89bb8931da42aa0c181ac93c819f8b36
7
+ data.tar.gz: bf4172f41056e08ef86bbcab7a6c56cd2d044d90f18ccd600ac59758ead73abf056283e7b2424771460b6a1ed6fd9a74d0d36ac790986629810d429167d259b6
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## 0.6.0.jhemphill3 07/11/2022
5
+ * Fixed query tagging for empty queries
6
+
4
7
  ## 0.5.2 01/24/2022
5
8
  * Fixed query tagging for empty queries
6
9
 
data/Gemfile.lock CHANGED
@@ -1,31 +1,31 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activerecord-instrumentation (0.5.2)
4
+ activerecord-instrumentation (0.6.0.jhemphill3)
5
5
  activerecord
6
6
  opentracing (~> 0.5)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (6.1.4.4)
12
- activesupport (= 6.1.4.4)
13
- activerecord (6.1.4.4)
14
- activemodel (= 6.1.4.4)
15
- activesupport (= 6.1.4.4)
16
- activesupport (6.1.4.4)
11
+ activemodel (6.1.6.1)
12
+ activesupport (= 6.1.6.1)
13
+ activerecord (6.1.6.1)
14
+ activemodel (= 6.1.6.1)
15
+ activesupport (= 6.1.6.1)
16
+ activesupport (6.1.6.1)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
20
20
  tzinfo (~> 2.0)
21
21
  zeitwerk (~> 2.3)
22
22
  ast (2.4.0)
23
- concurrent-ruby (1.1.9)
23
+ concurrent-ruby (1.1.10)
24
24
  diff-lcs (1.3)
25
- i18n (1.8.11)
25
+ i18n (1.11.0)
26
26
  concurrent-ruby (~> 1.0)
27
27
  jaro_winkler (1.5.4)
28
- minitest (5.15.0)
28
+ minitest (5.16.2)
29
29
  opentracing (0.5.0)
30
30
  opentracing_test_tracer (0.1.1)
31
31
  opentracing
@@ -66,7 +66,7 @@ GEM
66
66
  tzinfo (2.0.4)
67
67
  concurrent-ruby (~> 1.0)
68
68
  unicode-display_width (1.6.1)
69
- zeitwerk (2.5.3)
69
+ zeitwerk (2.6.0)
70
70
 
71
71
  PLATFORMS
72
72
  ruby
@@ -79,6 +79,7 @@ module ActiveRecord
79
79
  "db.instance" => db_instance,
80
80
  "db.cached" => payload.fetch(:cached, false),
81
81
  "db.type" => DB_TYPE,
82
+ "peer.mysql_db_name" => mysql_db_name_tag(payload.fetch(:connection, nil)&.raw_connection),
82
83
  "peer.address" => peer_address_tag
83
84
  }.merge(db_statement(payload))
84
85
  end
@@ -104,13 +105,19 @@ module ActiveRecord
104
105
  sanitizer ? sanitizer.sanitize(sql) : sql
105
106
  end
106
107
 
108
+ def mysql_db_name_tag(db_connection)
109
+ return db_connection.host if db_connection.respond_to?(:host)
110
+ return nil
111
+ end
112
+
107
113
  def peer_address_tag
108
- @peer_address_tag ||= [
109
- "#{connection_config.fetch(:adapter)}://",
110
- connection_config[:username],
111
- connection_config[:host] && "@#{connection_config[:host]}",
112
- "/#{db_instance}"
113
- ].join
114
+ @peer_address_tag ||=
115
+ [
116
+ "#{connection_config.fetch(:adapter)}://",
117
+ connection_config[:username],
118
+ connection_config[:host] && "@#{connection_config[:host]}",
119
+ "/#{db_instance}"
120
+ ].join
114
121
  end
115
122
 
116
123
  def db_instance
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module OpenTracing
5
- VERSION = "0.5.2"
5
+ VERSION = "0.6.0.jhemphill3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-instrumentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0.jhemphill3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SaleMove TechMovers
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-24 00:00:00.000000000 Z
12
+ date: 2022-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -209,11 +209,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
209
  version: '0'
210
210
  required_rubygems_version: !ruby/object:Gem::Requirement
211
211
  requirements:
212
- - - ">="
212
+ - - ">"
213
213
  - !ruby/object:Gem::Version
214
- version: '0'
214
+ version: 1.3.1
215
215
  requirements: []
216
- rubygems_version: 3.2.32
216
+ rubygems_version: 3.3.11
217
217
  signing_key:
218
218
  specification_version: 4
219
219
  summary: ActiveRecord OpenTracing intrumenter