activerecord-instrumentation 0.6.0.jhemphill2 → 0.6.0.jhemphill3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Gemfile.lock +7 -7
- data/lib/active_record/open_tracing/processor.rb +14 -17
- data/lib/active_record/open_tracing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95c186a845e1f54640ec23d41c6f4af63672c70a2b40eead66abd7dfdfa9a5d9
|
4
|
+
data.tar.gz: 5dbd6b7b69424ff53fe2aaaecd2c9980ea427f32ac85b69f779b6bd60fbfe1c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1542c660df6a46953df85ed993648afcf28b3a5195560176b528d7f03dd148ad404bbe53e732ea8ac4a0fa6f81cc471e89bb8931da42aa0c181ac93c819f8b36
|
7
|
+
data.tar.gz: bf4172f41056e08ef86bbcab7a6c56cd2d044d90f18ccd600ac59758ead73abf056283e7b2424771460b6a1ed6fd9a74d0d36ac790986629810d429167d259b6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
activerecord-instrumentation (0.6.0.
|
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.6)
|
12
|
-
activesupport (= 6.1.6)
|
13
|
-
activerecord (6.1.6)
|
14
|
-
activemodel (= 6.1.6)
|
15
|
-
activesupport (= 6.1.6)
|
16
|
-
activesupport (6.1.6)
|
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)
|
@@ -79,8 +79,8 @@ module ActiveRecord
|
|
79
79
|
"db.instance" => db_instance,
|
80
80
|
"db.cached" => payload.fetch(:cached, false),
|
81
81
|
"db.type" => DB_TYPE,
|
82
|
-
"
|
83
|
-
"peer.address" => peer_address_tag
|
82
|
+
"peer.mysql_db_name" => mysql_db_name_tag(payload.fetch(:connection, nil)&.raw_connection),
|
83
|
+
"peer.address" => peer_address_tag
|
84
84
|
}.merge(db_statement(payload))
|
85
85
|
end
|
86
86
|
|
@@ -105,22 +105,19 @@ module ActiveRecord
|
|
105
105
|
sanitizer ? sanitizer.sanitize(sql) : sql
|
106
106
|
end
|
107
107
|
|
108
|
-
def
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
else
|
113
|
-
@peer_address_tag = "farts"
|
114
|
-
# [
|
115
|
-
# "#{connection_config.fetch(:adapter)}://",
|
116
|
-
# connection_config[:username],
|
117
|
-
# connection_config[:host] && "@#{connection_config[:host]}",
|
118
|
-
# "/#{db_instance}"
|
119
|
-
# ].join
|
120
|
-
end
|
121
|
-
end
|
108
|
+
def mysql_db_name_tag(db_connection)
|
109
|
+
return db_connection.host if db_connection.respond_to?(:host)
|
110
|
+
return nil
|
111
|
+
end
|
122
112
|
|
123
|
-
|
113
|
+
def peer_address_tag
|
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
|
124
121
|
end
|
125
122
|
|
126
123
|
def db_instance
|