catpm 0.9.1 → 0.9.2
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/lib/catpm/trace.rb +8 -2
- data/lib/catpm/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: 7550489165d4ba6b3c476bd1f2637fc6e68eed8e3def5bd32420dfc0632ff2d7
|
|
4
|
+
data.tar.gz: ec9ed224bcd90cd67835842385305146736ce634310b9b62eaf33997bf7e2ff8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad84a45f6d0b8b508c94a5a9d0d06b9671a7820fedd93eda19eeee070b41669e625a814a6a2fab6e69fa80ae83edbaa81edd9a8f20e915d921973ba8a6e70822
|
|
7
|
+
data.tar.gz: 75cd050d65178c666e0369eecbc13c1fe1cb18f8d159f75c2078ecea7422e1844e4836c87320681d6b6d68718c9624f0b8abd67276888d28b09410265b43f8ad
|
data/lib/catpm/trace.rb
CHANGED
|
@@ -9,6 +9,12 @@ module Catpm
|
|
|
9
9
|
|
|
10
10
|
req_segments = Thread.current[:catpm_request_segments]
|
|
11
11
|
unless req_segments
|
|
12
|
+
# Inside a non-instrumented HTTP request — just run the block
|
|
13
|
+
# without promoting the span to a standalone endpoint
|
|
14
|
+
if Thread.current[:catpm_request_start]
|
|
15
|
+
return block.call if block
|
|
16
|
+
return nil
|
|
17
|
+
end
|
|
12
18
|
return trace(name, &block)
|
|
13
19
|
end
|
|
14
20
|
|
|
@@ -46,7 +52,7 @@ module Catpm
|
|
|
46
52
|
type: :custom, duration: duration_ms, detail: name,
|
|
47
53
|
source: source, started_at: start_time
|
|
48
54
|
)
|
|
49
|
-
elsif buffer
|
|
55
|
+
elsif buffer && !Thread.current[:catpm_request_start]
|
|
50
56
|
Collector.process_custom(
|
|
51
57
|
name: name, duration: duration_ms,
|
|
52
58
|
metadata: metadata, error: error, context: context
|
|
@@ -160,7 +166,7 @@ module Catpm
|
|
|
160
166
|
type: :custom, duration: duration_ms, detail: @name,
|
|
161
167
|
source: source, started_at: @start_time
|
|
162
168
|
)
|
|
163
|
-
elsif Catpm.enabled? && Catpm.buffer
|
|
169
|
+
elsif Catpm.enabled? && Catpm.buffer && !Thread.current[:catpm_request_start]
|
|
164
170
|
Collector.process_custom(
|
|
165
171
|
name: @name, duration: duration_ms,
|
|
166
172
|
metadata: @metadata, error: error, context: @context
|
data/lib/catpm/version.rb
CHANGED