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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1bb890d1a121d0351a7153a0575608c76c9b003b2d5798931fa4eaaca0067b81
4
- data.tar.gz: bb4b7b4978e199de34306e18aafcdcac0ed7cd1fcc7a784d685ebe1ba6e9793e
3
+ metadata.gz: 7550489165d4ba6b3c476bd1f2637fc6e68eed8e3def5bd32420dfc0632ff2d7
4
+ data.tar.gz: ec9ed224bcd90cd67835842385305146736ce634310b9b62eaf33997bf7e2ff8
5
5
  SHA512:
6
- metadata.gz: 1b377c63b639edf420597d451c2ef2349e73598ca7118bdda9a05c5a455ebad517c821f0cd2a8d8e9a6fde4b1dd71f15482442f9192158b08a6a5564996d3a6c
7
- data.tar.gz: ef93cd60ad7840b0a90fd5389ef3ec8f35016fd01eb5d19032fc7e73822c7218d1259a7c326ccfc80109f944ccddddb2eeb9e8e638dae8fe725d7741974704ac
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Catpm
4
- VERSION = '0.9.1'
4
+ VERSION = '0.9.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''