newrelic-infinite_tracing 6.12.0.367 → 7.0.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: c8701c192aa4a70795c34856b017f223549cb5ac0d64c6c6c1438745a0144019
4
- data.tar.gz: 6b0d930769e43571033465b841c41db78e8e703f4f281c2c4563257c89daa4c5
3
+ metadata.gz: 0c0cb119fdd9c9388989d99d116add07d20eeeaaab5f0b8e3bc533c4be9f750c
4
+ data.tar.gz: 925054cff0d639af379cecdaa726230221fe0a5d41def09a86f8e0455c0089e2
5
5
  SHA512:
6
- metadata.gz: 52c58c4f1d9074e3de7279a1e9fbaac50e1cac4d883ab1e180873df928e8eb1afe2936df50e017272105f028a5c36024435e8b726db3b28767ed5b4dcad16919
7
- data.tar.gz: 0da76cc8199bfb29cef261351086b26d7f1ea9f89166453df97e65bd887c211873d731a85fee9b9b584bce76775c6a6d973f73afd0fd7d0f0f0c57bfeb685b02
6
+ metadata.gz: 373451194aa1a8c8738582a74a2ffa7d10d9c2b0fc7110951caf68d90ed0465794d3835491c71dbb789b080f717b0eed6fc51a3c3530dcd05568e05d1f091266
7
+ data.tar.gz: 7f4a47aac1e4b26e600985e2abeadbf18f0f11c6ca38cf9a4b2422f21995fbe3a9f7193ca544ac4aa19efa548017f9aa7fc0c9396ed0e3b569cb17a4600429db
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.12.0.367
4
+ version: 7.0.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-07-14 00:00:00.000000000 Z
13
+ date: 2021-04-23 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.12.0.367
21
+ version: 7.0.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.12.0.367
28
+ version: 7.0.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.3
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