newrelic-infinite_tracing 6.13.1 → 7.2.0

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: bef1046e0185c1f27231f729d6c77fd2cf0374c6c3efccdb55e315a420f6ee27
4
- data.tar.gz: e114dbd2c7c4943223c83cde5c9b5cce69c1f1ce605b0b779810f88e7d824a3e
3
+ metadata.gz: 0e574f922f44f9ee1196985ebddbe874b1a46926fa028570153fa73603066528
4
+ data.tar.gz: 8ba90df52c51d0ba3d6577179e7042b2b6344731278bb5bca5fe9d36ffdeee12
5
5
  SHA512:
6
- metadata.gz: 8ec73a81c01f437e57dcf3000ef918dc165747774ed13a5875eded180d06fe28f78d784d0688434b07d84225e2f4c53110fc27b7d3dfb9d0760f67c42c0e7e73
7
- data.tar.gz: 533cdf998b1af809dff4854a3823ffd72e96a0b93e1d47e64234eb9b019a0e1530e110f41d368fc2b42f5df3ee3bc0311869c47e05946465a34f08d63aa6ff07
6
+ metadata.gz: 226f6724fef8f7850ab25ea7d10a6d60abf7c29b389b3e78d2663c738be189b59495cfb9500d1e046c6fed4215c815628d09fea85cd678c748aec7502af16f30
7
+ data.tar.gz: 9018f9c2bfcc7b805a1fd5f8cc8da0ebcb919421915fb362ea353a34aa094f03838cace140fea1171a6a227f72914ba7470ad15ee81fd79753d1910865479e95
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
1
  # New Relic Infinite Tracing for Ruby Agent Release Notes #
2
+
3
+ ## v7.0.0
4
+ * Bugfix: Fixes an intermittent bug where the agent was unable to start when infinite tracing was enabled.
5
+
6
+ ## v6.15.0
7
+ * Adds data from the agents connect response `request_headers_map` to the metadata for the connection to the infinite trace observer.
2
8
 
3
9
  ## v6.12.0
4
10
 
@@ -77,6 +77,7 @@ module NewRelic::Agent
77
77
 
78
78
  case error
79
79
  when GRPC::Unavailable then restart
80
+ when GRPC::FailedPrecondition then restart
80
81
  when GRPC::Unimplemented then suspend
81
82
  else
82
83
  # Set exponential backoff to false so we'll reconnect at periodic (15 second) intervals instead
@@ -142,6 +143,7 @@ module NewRelic::Agent
142
143
 
143
144
  def start_streaming exponential_backoff=true
144
145
  return if suspended?
146
+ Connection.instance.wait_for_agent_connect
145
147
  @lock.synchronize { @response_handler = record_spans exponential_backoff }
146
148
  end
147
149
 
@@ -152,8 +154,6 @@ module NewRelic::Agent
152
154
  def record_span_batches exponential_backoff
153
155
  RecordStatusHandler.new self, Connection.record_span_batches(self, buffer.batch_enumerator, exponential_backoff)
154
156
  end
155
-
156
157
  end
157
-
158
158
  end
159
159
  end
@@ -81,8 +81,15 @@ module NewRelic::Agent
81
81
  # We attempt to connect and record spans with reconnection backoff in order to deal with
82
82
  # unavailable errors coming from the stub being created and record_span call
83
83
  def rpc
84
+ wait_for_agent_connect
84
85
  @rpc ||= Channel.new.stub
85
86
  end
87
+
88
+ def wait_for_agent_connect
89
+ @lock.synchronize do
90
+ @agent_started.wait(@lock) if !@agent_connected
91
+ end
92
+ end
86
93
 
87
94
  # The metadata for the RPC calls is a blocking call waiting for the Agent to
88
95
  # connect and receive the server side configuration, which contains the license_key
@@ -91,12 +98,12 @@ module NewRelic::Agent
91
98
  return @metadata if @metadata
92
99
 
93
100
  @lock.synchronize do
94
- @agent_started.wait(@lock) if !@agent_connected
95
101
 
96
102
  @metadata = {
97
103
  "license_key" => license_key,
98
104
  "agent_run_token" => agent_id
99
105
  }
106
+ @metadata.merge!(request_headers_map)
100
107
  end
101
108
  end
102
109
 
@@ -138,6 +145,12 @@ module NewRelic::Agent
138
145
  NewRelic::Agent.config[:license_key]
139
146
  end
140
147
 
148
+ def request_headers_map
149
+ headers = NewRelic::Agent.agent.service.instance_variable_get(:@request_headers_map) || NewRelic::EMPTY_HASH
150
+ # transform_keys only 2.5+, but infinite tracing is 2.5+ only also
151
+ headers.transform_keys(&:downcase)
152
+ end
153
+
141
154
  # Continues retrying the connection at backoff intervals until a successful connection is made
142
155
  def with_reconnection_backoff exponential_backoff=true, &block
143
156
  @connection_attempts = 0
@@ -1,6 +1,8 @@
1
1
  #-*- coding: utf-8 -*-
2
2
  # frozen_string_literal: true
3
3
 
4
+ require 'fileutils'
5
+
4
6
  agent_lib = File.expand_path('../../lib', __FILE__)
5
7
  $LOAD_PATH.unshift(agent_lib) unless $LOAD_PATH.include?(agent_lib)
6
8
 
@@ -30,9 +32,9 @@ Gem::Specification.new do |s|
30
32
 
31
33
  s.name = "newrelic-infinite_tracing"
32
34
  s.version = NewRelic::VERSION::STRING
33
- s.required_ruby_version = '>= 2.3.0'
35
+ s.required_ruby_version = '>= 2.5.0'
34
36
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
35
- s.authors = [ "Rachel Klein", "Tanna McClure", "Michael Lang" ]
37
+ s.authors = [ "Aaron Huntsman", "Tanna McClure", "Michael Lang" ]
36
38
  s.date = Time.now.strftime('%Y-%m-%d')
37
39
  s.licenses = ['Apache-2.0']
38
40
  s.description = <<-EOS
@@ -74,7 +76,7 @@ EOS
74
76
  s.summary = "New Relic Infinite Tracing for the Ruby agent"
75
77
 
76
78
  s.add_dependency 'newrelic_rpm', NewRelic::VERSION::STRING
77
- s.add_dependency 'grpc', '~> 1.28.0'
79
+ s.add_dependency 'grpc', '~> 1.34'
78
80
 
79
81
  s.add_development_dependency 'rake', '12.3.3'
80
82
  s.add_development_dependency 'rb-inotify', '0.9.10' # locked to support < Ruby 2.3 (and listen 3.0.8)
@@ -88,5 +90,5 @@ EOS
88
90
  s.add_development_dependency 'hometown', '~> 0.2.5'
89
91
  s.add_development_dependency 'bundler'
90
92
 
91
- s.add_development_dependency 'grpc-tools', "~> 1.14.0"
93
+ s.add_development_dependency 'grpc-tools', "~> 1.14"
92
94
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic-infinite_tracing
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.13.1
4
+ version: 7.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - Rachel Klein
7
+ - Aaron Huntsman
8
8
  - Tanna McClure
9
9
  - Michael Lang
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-09-25 00:00:00.000000000 Z
13
+ date: 2021-07-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: newrelic_rpm
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 6.13.1
21
+ version: 7.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 6.13.1
28
+ version: 7.2.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: grpc
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 1.28.0
35
+ version: '1.34'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 1.28.0
42
+ version: '1.34'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rake
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -200,14 +200,14 @@ dependencies:
200
200
  requirements:
201
201
  - - "~>"
202
202
  - !ruby/object:Gem::Version
203
- version: 1.14.0
203
+ version: '1.14'
204
204
  type: :development
205
205
  prerelease: false
206
206
  version_requirements: !ruby/object:Gem::Requirement
207
207
  requirements:
208
208
  - - "~>"
209
209
  - !ruby/object:Gem::Version
210
- version: 1.14.0
210
+ version: '1.14'
211
211
  description: |
212
212
  The New Relic Ruby agent requires the gem newrelic_rpm, and it includes distributed
213
213
  tracing that uses head-based sampling (standard distributed tracing).
@@ -277,14 +277,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
277
277
  requirements:
278
278
  - - ">="
279
279
  - !ruby/object:Gem::Version
280
- version: 2.3.0
280
+ version: 2.5.0
281
281
  required_rubygems_version: !ruby/object:Gem::Requirement
282
282
  requirements:
283
283
  - - ">"
284
284
  - !ruby/object:Gem::Version
285
285
  version: 1.3.1
286
286
  requirements: []
287
- rubygems_version: 3.1.4
287
+ rubygems_version: 3.1.6
288
288
  signing_key:
289
289
  specification_version: 4
290
290
  summary: New Relic Infinite Tracing for the Ruby agent