stackify-ruby-apm 1.14.5 → 1.14.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stackify_apm/normalizers/active_record.rb +21 -2
- data/lib/stackify_apm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 207d50046b455753b802c84ef15314d336df3376b986e98f8fff5014aeed6370
|
4
|
+
data.tar.gz: bfc2a15d2d26c9aea7263945b6a0f10c02da58f6c1ed0dfb6ea13fc2adcd6c38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc2621fd6efa921753d1db81649e7cbff2f26b35350798c82a01a2326752ba2db8e42ccd5de1730a69a9516a849b48943415b9160ffeaa0b70b5baea54f3cb9e
|
7
|
+
data.tar.gz: 7f6b9b487101dad81b0b29acfe7c1844d29a778ff48235a9180160c2724dd78a57a8d6eee515169a01e4e36f92156ee9f590aa2a88de4043f1c47de64666d061
|
@@ -14,8 +14,7 @@ module StackifyRubyAPM
|
|
14
14
|
|
15
15
|
def initialize(*args)
|
16
16
|
super(*args)
|
17
|
-
|
18
|
-
@type = format('db.%s.sql', lookup_adapter || 'unknown').freeze
|
17
|
+
@type = nil
|
19
18
|
end
|
20
19
|
|
21
20
|
def normalize(_transaction, _name, payload)
|
@@ -25,6 +24,11 @@ module StackifyRubyAPM
|
|
25
24
|
check_prepared_stmt(statement, payload)
|
26
25
|
name = payload[:sql] || payload[:name] || 'Default'
|
27
26
|
context = Span::Context.new(statement)
|
27
|
+
|
28
|
+
if (@type == nil)
|
29
|
+
@type = format('db.%s.sql', lookup_adapter || 'unknown').freeze
|
30
|
+
end
|
31
|
+
|
28
32
|
[name, @type, context]
|
29
33
|
end
|
30
34
|
|
@@ -41,6 +45,21 @@ module StackifyRubyAPM
|
|
41
45
|
props
|
42
46
|
end
|
43
47
|
|
48
|
+
# Ideally the application doesn't connect to the database during boot,
|
49
|
+
# but sometimes it does. In case it did, we want to empty out the
|
50
|
+
# connection pools so that a non-database-using process (e.g. a master
|
51
|
+
# process in a forking server model) doesn't retain a needless
|
52
|
+
# connection. If it was needed, the incremental cost of reestablishing
|
53
|
+
# this connection is trivial: the rest of the pool would need to be
|
54
|
+
# populated anyway.
|
55
|
+
#
|
56
|
+
# Reference: https://github.com/rails/rails/blob/main/activerecord/lib/active_record/railtie.rb#L253
|
57
|
+
#
|
58
|
+
# Miko: Considering we are getting the connection method, it is retrieving connection from the connection pool
|
59
|
+
# Connection Method: lib/active_record/connection_handling.rb#L264
|
60
|
+
# Retrieve Connection: lib/active_record/connection_handling.rb#L309
|
61
|
+
# Handler Retrieve Connection: lib/active_record/connection_adapters/abstract/connection_pool.rb#L1111
|
62
|
+
|
44
63
|
def lookup_adapter
|
45
64
|
::ActiveRecord::Base.connection.adapter_name.downcase
|
46
65
|
rescue StandardError => error
|
data/lib/stackify_apm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stackify-ruby-apm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stackify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|