activerecord-instrumentation 0.5.2 → 0.6.0.jhemphill1

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: 2f9fe8e655275c95316af6091d55c794c384c20b721c301056661aa4eca8aafd
4
+ data.tar.gz: 128ba9528fdc517e3fddfab4ad75cad0cfea8fd4f4dab7f371cfd0b7c79c5699
5
5
  SHA512:
6
- metadata.gz: 0cbfa60d7a540c72a4a7505504e933c7d2e6e9f0431f1829e0ec2c9fad6528807ec67a32d0e2a9108b52dc424ab791051fe846057bfec637746acd2791fcfda2
7
- data.tar.gz: 8ca19599f279459af06f90fffa5bc0f9d8f23447352a7a3fb47fe0919c18c729bf5ce41c0cf1eae188632a43e35cac581da603126a7818848189b4c2815eddb5
6
+ metadata.gz: 1b3b8da9054b12445889993ee125a3ef456ff97f056ef3ee6194d3bfc100eb263401335e797681334dd58745bc3d9108110bf3b2aa9e69212d25f68a9e840a03
7
+ data.tar.gz: de602d96113006ff75dbaf44a497289f5fcc193b1fd8a5797a35c3a4bfafa65a546effd7152db406ca901dfc738bae538ef214c24a485888ac9a96e52bf4b668
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activerecord-instrumentation (0.5.2)
4
+ activerecord-instrumentation (0.6.0.jhemphill1)
5
5
  activerecord
6
6
  opentracing (~> 0.5)
7
7
 
@@ -22,7 +22,7 @@ GEM
22
22
  ast (2.4.0)
23
23
  concurrent-ruby (1.1.9)
24
24
  diff-lcs (1.3)
25
- i18n (1.8.11)
25
+ i18n (1.10.0)
26
26
  concurrent-ruby (~> 1.0)
27
27
  jaro_winkler (1.5.4)
28
28
  minitest (5.15.0)
@@ -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.5.4)
70
70
 
71
71
  PLATFORMS
72
72
  ruby
@@ -79,7 +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.address" => peer_address_tag
82
+ "peer.address" => peer_address_tag(payload.fetch(:connection, false))
83
83
  }.merge(db_statement(payload))
84
84
  end
85
85
 
@@ -104,13 +104,21 @@ module ActiveRecord
104
104
  sanitizer ? sanitizer.sanitize(sql) : sql
105
105
  end
106
106
 
107
- 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
107
+ def peer_address_tag(connection)
108
+ unless defined? @peer_address_tag
109
+ if connection.respond_to? :host # using the postgres adapter
110
+ @peer_address_tag = connection.host
111
+ else
112
+ @peer_address_tag = [
113
+ "#{connection_config.fetch(:adapter)}://",
114
+ connection_config[:username],
115
+ connection_config[:host] && "@#{connection_config[:host]}",
116
+ "/#{db_instance}"
117
+ ].join
118
+ end
119
+ end
120
+
121
+ @peer_address_tag
114
122
  end
115
123
 
116
124
  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.jhemphill1"
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.jhemphill1
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-11 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.1.6
217
217
  signing_key:
218
218
  specification_version: 4
219
219
  summary: ActiveRecord OpenTracing intrumenter