newrelic-infinite_tracing 7.2.0 → 8.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/infinite_tracing/agent_integrations/agent.rb +3 -4
- data/lib/infinite_tracing/agent_integrations/datastore_segment.rb +3 -0
- data/lib/infinite_tracing/agent_integrations/external_request_segment.rb +3 -0
- data/lib/infinite_tracing/agent_integrations/segment.rb +3 -1
- data/lib/infinite_tracing/agent_integrations.rb +1 -1
- data/lib/infinite_tracing/channel.rb +5 -7
- data/lib/infinite_tracing/client.rb +6 -6
- data/lib/infinite_tracing/config.rb +7 -7
- data/lib/infinite_tracing/connection.rb +5 -10
- data/lib/infinite_tracing/constants.rb +6 -6
- data/lib/infinite_tracing/proto/infinite_tracing_pb.rb +0 -1
- data/lib/infinite_tracing/proto/infinite_tracing_services_pb.rb +0 -2
- data/lib/infinite_tracing/record_status_handler.rb +1 -1
- data/lib/infinite_tracing/streaming_buffer.rb +16 -18
- data/lib/infinite_tracing/suspended_streaming_buffer.rb +3 -3
- data/lib/infinite_tracing/transformer.rb +4 -4
- data/lib/infinite_tracing/worker.rb +5 -7
- data/lib/infinite_tracing.rb +1 -1
- data/lib/new_relic/infinite_tracing.rb +1 -1
- data/lib/newrelic/infinite_tracing.rb +1 -1
- data/newrelic-infinite_tracing.gemspec +9 -11
- data/tasks/all.rb +2 -2
- data/tasks/proto.rake +1 -2
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 527d78ab51739c47cddc188e5a7da51706047e241b1b03796aa89ff44fd265d3
|
4
|
+
data.tar.gz: d0395efcb3a95a1c0225974fe2dfb0a3b60bdc80c70f00018e1fc25b4d666c14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1351c5386e5ad3aedc01695e09b1810210d576d7c4dcd1e3283f3e88ebfa3c06ee1142e9df4653cbf002697785f7c6cf92fddcd4d9e9e68bda3de97e67e1d32
|
7
|
+
data.tar.gz: e109ff513ec8aaad78dcc4366fa63dcefdaf07e4f2e8d6302e2c164d4d7279664d74cb714a056f9c5d6c904f3d6c3cb6d7b731ad3cda264758a6cc6a96d793d1
|
data/Rakefile
CHANGED
@@ -5,14 +5,13 @@
|
|
5
5
|
|
6
6
|
module NewRelic::Agent
|
7
7
|
NewRelic::Agent.logger.debug "Installing Infinite Tracer in Agent"
|
8
|
-
|
9
|
-
Agent.class_eval do
|
10
8
|
|
9
|
+
Agent.class_eval do
|
11
10
|
def new_infinite_tracer
|
12
11
|
# We must start streaming in a thread or we block/deadlock the
|
13
12
|
# entire start up process for the Agent.
|
14
|
-
InfiniteTracing::Client.new.tap do |client|
|
15
|
-
@infinite_tracer_thread = InfiniteTracing::Worker.new(:infinite_tracer) do
|
13
|
+
InfiniteTracing::Client.new.tap do |client|
|
14
|
+
@infinite_tracer_thread = InfiniteTracing::Worker.new(:infinite_tracer) do
|
16
15
|
NewRelic::Agent.logger.debug "Opening Infinite Tracer Stream with gRPC server"
|
17
16
|
client.start_streaming
|
18
17
|
end
|
@@ -8,6 +8,9 @@ module NewRelic
|
|
8
8
|
class Transaction
|
9
9
|
class DatastoreSegment
|
10
10
|
def record_span_event
|
11
|
+
# don't record a span event if the transaction is ignored
|
12
|
+
return if transaction.ignore?
|
13
|
+
|
11
14
|
tracer = ::NewRelic::Agent.agent.infinite_tracer
|
12
15
|
tracer << Proc.new { SpanEventPrimitive.for_datastore_segment self }
|
13
16
|
end
|
@@ -8,6 +8,9 @@ module NewRelic
|
|
8
8
|
class Transaction
|
9
9
|
class ExternalRequestSegment
|
10
10
|
def record_span_event
|
11
|
+
# don't record a span event if the transaction is ignored
|
12
|
+
return if transaction.ignore?
|
13
|
+
|
11
14
|
tracer = ::NewRelic::Agent.agent.infinite_tracer
|
12
15
|
tracer << Proc.new { SpanEventPrimitive.for_external_request_segment self }
|
13
16
|
end
|
@@ -7,12 +7,14 @@ module NewRelic
|
|
7
7
|
module Agent
|
8
8
|
class Transaction
|
9
9
|
class Segment
|
10
|
-
|
11
10
|
def segment_complete
|
12
11
|
record_span_event
|
13
12
|
end
|
14
13
|
|
15
14
|
def record_span_event
|
15
|
+
# don't record a span event if the transaction is ignored
|
16
|
+
return if transaction.ignore?
|
17
|
+
|
16
18
|
tracer = ::NewRelic::Agent.agent.infinite_tracer
|
17
19
|
tracer << Proc.new { SpanEventPrimitive.for_segment self }
|
18
20
|
end
|
@@ -6,23 +6,22 @@
|
|
6
6
|
module NewRelic::Agent
|
7
7
|
module InfiniteTracing
|
8
8
|
class Channel
|
9
|
-
|
10
9
|
def stub
|
11
10
|
NewRelic::Agent.logger.debug "Infinite Tracer Opening Channel to #{host_and_port}"
|
12
11
|
|
13
12
|
Com::Newrelic::Trace::V1::IngestService::Stub.new \
|
14
|
-
host_and_port,
|
15
|
-
credentials,
|
13
|
+
host_and_port,
|
14
|
+
credentials,
|
16
15
|
channel_override: channel
|
17
16
|
end
|
18
17
|
|
19
18
|
def channel
|
20
19
|
GRPC::Core::Channel.new(host_and_port, settings, credentials)
|
21
20
|
end
|
22
|
-
|
21
|
+
|
23
22
|
def credentials
|
24
23
|
if Config.local?
|
25
|
-
:this_channel_is_insecure
|
24
|
+
:this_channel_is_insecure
|
26
25
|
else
|
27
26
|
# Uses system configured certificates by default
|
28
27
|
GRPC::Core::ChannelCredentials.new
|
@@ -36,10 +35,9 @@ module NewRelic::Agent
|
|
36
35
|
def settings
|
37
36
|
{
|
38
37
|
'grpc.minimal_stack' => 1,
|
39
|
-
'grpc.enable_deadline_checking' => 0
|
38
|
+
'grpc.enable_deadline_checking' => 0
|
40
39
|
}
|
41
40
|
end
|
42
|
-
|
43
41
|
end
|
44
42
|
end
|
45
43
|
end
|
@@ -7,9 +7,9 @@
|
|
7
7
|
#
|
8
8
|
# Restarting the client will cause a new connection to the gRPC server.
|
9
9
|
# When the client is restarted, a new streaming buffer is started and contents of old
|
10
|
-
# buffer are transferred to the new buffer.
|
10
|
+
# buffer are transferred to the new buffer.
|
11
11
|
#
|
12
|
-
# Suspending the client will prevent the client from attempting to reconnect to the
|
12
|
+
# Suspending the client will prevent the client from attempting to reconnect to the
|
13
13
|
# gRPC server, but will still continue to record the span events `seen` metric.
|
14
14
|
module NewRelic::Agent
|
15
15
|
module InfiniteTracing
|
@@ -52,7 +52,7 @@ module NewRelic::Agent
|
|
52
52
|
# Turns camelcase base class name into upper snake case version of the name.
|
53
53
|
def formatted_class_name class_name
|
54
54
|
class_name = class_name.split(":")[-1]
|
55
|
-
formatted_class_name = (class_name.gsub!(/(.)([A-Z])/,'\1_\2') || class_name).upcase
|
55
|
+
formatted_class_name = (class_name.gsub!(/(.)([A-Z])/, '\1_\2') || class_name).upcase
|
56
56
|
end
|
57
57
|
|
58
58
|
# Literal codes are all mapped to unique class names, so we can deduce the
|
@@ -91,7 +91,7 @@ module NewRelic::Agent
|
|
91
91
|
|
92
92
|
# This method is called when the server closes the record status stream without
|
93
93
|
# raising an error. The Channel/Connection is not closed or reset in this case.
|
94
|
-
# We simply start streaming again, which will reuse the channel/connection to the
|
94
|
+
# We simply start streaming again, which will reuse the channel/connection to the
|
95
95
|
# server and re-establish the gRPC bi-directional stream. Useful for the server
|
96
96
|
# to initiate a load-balancing scheme.
|
97
97
|
def handle_close
|
@@ -100,7 +100,7 @@ module NewRelic::Agent
|
|
100
100
|
start_streaming
|
101
101
|
end
|
102
102
|
|
103
|
-
# Places the client into suspended state whereby client will no longer attempt to
|
103
|
+
# Places the client into suspended state whereby client will no longer attempt to
|
104
104
|
# reconnect to the gRPC server nor will it attempt to send span events henceforth.
|
105
105
|
# The Suspended Streaming Buffer will be installed in this state.
|
106
106
|
def suspend
|
@@ -141,7 +141,7 @@ module NewRelic::Agent
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
-
def start_streaming exponential_backoff=true
|
144
|
+
def start_streaming exponential_backoff = true
|
145
145
|
return if suspended?
|
146
146
|
Connection.instance.wait_for_agent_connect
|
147
147
|
@lock.synchronize { @response_handler = record_spans exponential_backoff }
|
@@ -24,9 +24,9 @@ module NewRelic::Agent
|
|
24
24
|
# AND the collect_span_events connect response field, AND
|
25
25
|
# c) A Trace Observer host is configured by setting infinite_tracing.trace_observer.host.
|
26
26
|
def enabled?
|
27
|
-
distributed_tracing_enabled? &&
|
28
|
-
|
29
|
-
|
27
|
+
distributed_tracing_enabled? &&
|
28
|
+
span_events_enabled? &&
|
29
|
+
trace_observer_configured?
|
30
30
|
end
|
31
31
|
|
32
32
|
# Distributed Tracing must be enabled for Infinite Tracing
|
@@ -39,9 +39,9 @@ module NewRelic::Agent
|
|
39
39
|
NewRelic::Agent.config[:'span_events.enabled']
|
40
40
|
end
|
41
41
|
|
42
|
-
# running locally is akin to communicating with the gRPC server with an
|
42
|
+
# running locally is akin to communicating with the gRPC server with an
|
43
43
|
# unencrypted channel. Generally, this is _not_ allowed by the agent
|
44
|
-
# in normal use-cases. The only known use-case for this is when
|
44
|
+
# in normal use-cases. The only known use-case for this is when
|
45
45
|
# streaming under TEST conditions.
|
46
46
|
def local?
|
47
47
|
test_framework?
|
@@ -74,7 +74,7 @@ module NewRelic::Agent
|
|
74
74
|
port_from_host_entry || NewRelic::Agent.config[:'infinite_tracing.trace_observer.port']
|
75
75
|
end
|
76
76
|
|
77
|
-
# The scheme is based on whether the Trace Observer is running locally or remotely.
|
77
|
+
# The scheme is based on whether the Trace Observer is running locally or remotely.
|
78
78
|
# Remote unsecure (unencypted) streaming is disallowed!
|
79
79
|
def trace_observer_scheme
|
80
80
|
local? ? NewRelic::HTTP : NewRelic::HTTPS
|
@@ -95,7 +95,7 @@ module NewRelic::Agent
|
|
95
95
|
"#{trace_observer_host}:#{trace_observer_port}"
|
96
96
|
end
|
97
97
|
|
98
|
-
# The maximum number of span events the Streaming Buffer can hold when buffering
|
98
|
+
# The maximum number of span events the Streaming Buffer can hold when buffering
|
99
99
|
# to stream across the gRPC channel.
|
100
100
|
def span_events_queue_size
|
101
101
|
NewRelic::Agent.config[:'span_events.queue_size']
|
@@ -18,8 +18,6 @@
|
|
18
18
|
module NewRelic::Agent
|
19
19
|
module InfiniteTracing
|
20
20
|
class Connection
|
21
|
-
|
22
|
-
|
23
21
|
# listens for server side configurations added to the agent. When a new config is
|
24
22
|
# added, we have a new agent run token and need to restart the client's RPC stream
|
25
23
|
# with the new metadata information.
|
@@ -34,7 +32,6 @@ module NewRelic::Agent
|
|
34
32
|
end
|
35
33
|
|
36
34
|
class << self
|
37
|
-
|
38
35
|
def instance
|
39
36
|
@@instance ||= new
|
40
37
|
end
|
@@ -65,8 +62,8 @@ module NewRelic::Agent
|
|
65
62
|
# We attempt to connect and record spans with reconnection backoff in order to deal with
|
66
63
|
# unavailable errors coming from the stub being created and record_span call
|
67
64
|
def record_spans client, enumerator, exponential_backoff
|
68
|
-
|
69
|
-
|
65
|
+
@active_clients[client] = client
|
66
|
+
with_reconnection_backoff(exponential_backoff) { rpc.record_span enumerator, metadata: metadata }
|
70
67
|
end
|
71
68
|
|
72
69
|
# RPC calls will pass the calling client instance in. We track this
|
@@ -84,7 +81,7 @@ module NewRelic::Agent
|
|
84
81
|
wait_for_agent_connect
|
85
82
|
@rpc ||= Channel.new.stub
|
86
83
|
end
|
87
|
-
|
84
|
+
|
88
85
|
def wait_for_agent_connect
|
89
86
|
@lock.synchronize do
|
90
87
|
@agent_started.wait(@lock) if !@agent_connected
|
@@ -98,7 +95,6 @@ module NewRelic::Agent
|
|
98
95
|
return @metadata if @metadata
|
99
96
|
|
100
97
|
@lock.synchronize do
|
101
|
-
|
102
98
|
@metadata = {
|
103
99
|
"license_key" => license_key,
|
104
100
|
"agent_run_token" => agent_id
|
@@ -152,7 +148,7 @@ module NewRelic::Agent
|
|
152
148
|
end
|
153
149
|
|
154
150
|
# Continues retrying the connection at backoff intervals until a successful connection is made
|
155
|
-
def with_reconnection_backoff exponential_backoff=true, &block
|
151
|
+
def with_reconnection_backoff exponential_backoff = true, &block
|
156
152
|
@connection_attempts = 0
|
157
153
|
begin
|
158
154
|
yield
|
@@ -166,7 +162,7 @@ module NewRelic::Agent
|
|
166
162
|
end
|
167
163
|
end
|
168
164
|
|
169
|
-
def retry_connection_period exponential_backoff=true
|
165
|
+
def retry_connection_period exponential_backoff = true
|
170
166
|
if exponential_backoff
|
171
167
|
NewRelic::CONNECT_RETRY_PERIODS[@connection_attempts] || NewRelic::MAX_RETRY_PERIOD
|
172
168
|
else
|
@@ -178,7 +174,6 @@ module NewRelic::Agent
|
|
178
174
|
def note_connect_failure
|
179
175
|
@connection_attempts += 1
|
180
176
|
end
|
181
|
-
|
182
177
|
end
|
183
178
|
end
|
184
179
|
end
|
@@ -6,14 +6,14 @@
|
|
6
6
|
module NewRelic::Agent
|
7
7
|
module InfiniteTracing
|
8
8
|
module Constants
|
9
|
-
SUPPORTABILITY_PREFIX
|
9
|
+
SUPPORTABILITY_PREFIX = "Supportability/InfiniteTracing/Span"
|
10
10
|
|
11
|
-
SPANS_SEEN_METRIC
|
12
|
-
SPANS_SENT_METRIC
|
13
|
-
QUEUE_DUMPED_METRIC
|
14
|
-
RESPONSE_ERROR_METRIC
|
11
|
+
SPANS_SEEN_METRIC = "#{SUPPORTABILITY_PREFIX}/Seen"
|
12
|
+
SPANS_SENT_METRIC = "#{SUPPORTABILITY_PREFIX}/Sent"
|
13
|
+
QUEUE_DUMPED_METRIC = "#{SUPPORTABILITY_PREFIX}/AgentQueueDumped"
|
14
|
+
RESPONSE_ERROR_METRIC = "#{SUPPORTABILITY_PREFIX}/Response/Error"
|
15
15
|
|
16
|
-
GRPC_ERROR_NAME_METRIC
|
16
|
+
GRPC_ERROR_NAME_METRIC = "#{SUPPORTABILITY_PREFIX}/gRPC/%s"
|
17
17
|
GRPC_OTHER_ERROR_METRIC = GRPC_ERROR_NAME_METRIC % "Other"
|
18
18
|
end
|
19
19
|
end
|
@@ -6,7 +6,6 @@
|
|
6
6
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
7
7
|
# source: infinite_tracing.proto
|
8
8
|
|
9
|
-
|
10
9
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
11
10
|
add_message "com.newrelic.trace.v1.SpanBatch" do
|
12
11
|
repeated :spans, :message, 1, "com.newrelic.trace.v1.Span"
|
@@ -11,14 +11,12 @@
|
|
11
11
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
12
12
|
#
|
13
13
|
|
14
|
-
|
15
14
|
module Com
|
16
15
|
module Newrelic
|
17
16
|
module Trace
|
18
17
|
module V1
|
19
18
|
module IngestService
|
20
19
|
class Service
|
21
|
-
|
22
20
|
include GRPC::GenericService
|
23
21
|
|
24
22
|
self.marshal_class_method = :encode
|
@@ -7,7 +7,6 @@
|
|
7
7
|
# class. The enumerator is blocking while the queue is empty.
|
8
8
|
module NewRelic::Agent
|
9
9
|
module InfiniteTracing
|
10
|
-
|
11
10
|
BATCH_SIZE = 100
|
12
11
|
|
13
12
|
class StreamingBuffer
|
@@ -15,11 +14,11 @@ module NewRelic::Agent
|
|
15
14
|
include Enumerable
|
16
15
|
extend Forwardable
|
17
16
|
def_delegators :@queue, :empty?, :num_waiting, :push
|
18
|
-
|
17
|
+
|
19
18
|
DEFAULT_QUEUE_SIZE = 10_000
|
20
|
-
FLUSH_DELAY
|
21
|
-
MAX_FLUSH_WAIT
|
22
|
-
|
19
|
+
FLUSH_DELAY = 0.005
|
20
|
+
MAX_FLUSH_WAIT = 3 # three seconds
|
21
|
+
|
23
22
|
attr_reader :queue
|
24
23
|
|
25
24
|
def initialize max_size = DEFAULT_QUEUE_SIZE
|
@@ -29,7 +28,7 @@ module NewRelic::Agent
|
|
29
28
|
@batch = Array.new
|
30
29
|
end
|
31
30
|
|
32
|
-
# Dumps the contents of this streaming buffer onto
|
31
|
+
# Dumps the contents of this streaming buffer onto
|
33
32
|
# the given buffer and closes the queue
|
34
33
|
def transfer new_buffer
|
35
34
|
@lock.synchronize do
|
@@ -67,7 +66,7 @@ module NewRelic::Agent
|
|
67
66
|
@queue.num_waiting.times { @queue.push nil }
|
68
67
|
close_queue
|
69
68
|
|
70
|
-
# Logs if we're throwing away spans because nothing's
|
69
|
+
# Logs if we're throwing away spans because nothing's
|
71
70
|
# waiting to take them off the queue.
|
72
71
|
if @queue.num_waiting == 0 && !@queue.empty?
|
73
72
|
NewRelic::Agent.logger.warn "Discarding #{@queue.size} segments on Streaming Buffer"
|
@@ -75,8 +74,8 @@ module NewRelic::Agent
|
|
75
74
|
end
|
76
75
|
|
77
76
|
# Only wait a short while for queue to flush
|
78
|
-
cutoff =
|
79
|
-
until @queue.empty? ||
|
77
|
+
cutoff = Process.clock_gettime(Process::CLOCK_MONOTONIC) + MAX_FLUSH_WAIT
|
78
|
+
until @queue.empty? || Process.clock_gettime(Process::CLOCK_MONOTONIC) >= cutoff do sleep(FLUSH_DELAY) end
|
80
79
|
end
|
81
80
|
|
82
81
|
def close_queue
|
@@ -87,9 +86,9 @@ module NewRelic::Agent
|
|
87
86
|
# items off the queue while any items are present
|
88
87
|
# If +nil+ is popped, the queue is closing.
|
89
88
|
#
|
90
|
-
# The segment is transformed into a serializable
|
89
|
+
# The segment is transformed into a serializable
|
91
90
|
# span here so processing is taking place within
|
92
|
-
# the gRPC call's thread rather than in the main
|
91
|
+
# the gRPC call's thread rather than in the main
|
93
92
|
# application thread.
|
94
93
|
def enumerator
|
95
94
|
return enum_for(:enumerator) unless block_given?
|
@@ -106,16 +105,16 @@ module NewRelic::Agent
|
|
106
105
|
|
107
106
|
# Returns the blocking enumerator that will pop
|
108
107
|
# items off the queue while any items are present
|
109
|
-
#
|
110
|
-
# yielding is deferred until batch_size spans is
|
108
|
+
#
|
109
|
+
# yielding is deferred until batch_size spans is
|
111
110
|
# reached.
|
112
111
|
#
|
113
|
-
# If +nil+ is popped, the queue is closing. A
|
112
|
+
# If +nil+ is popped, the queue is closing. A
|
114
113
|
# final yield on non-empty batch is fired.
|
115
114
|
#
|
116
|
-
# The segment is transformed into a serializable
|
115
|
+
# The segment is transformed into a serializable
|
117
116
|
# span here so processing is taking place within
|
118
|
-
# the gRPC call's thread rather than in the main
|
117
|
+
# the gRPC call's thread rather than in the main
|
119
118
|
# application thread.
|
120
119
|
def batch_enumerator
|
121
120
|
return enum_for(:enumerator) unless block_given?
|
@@ -139,7 +138,7 @@ module NewRelic::Agent
|
|
139
138
|
|
140
139
|
def span_event proc_or_segment
|
141
140
|
if proc_or_segment.is_a?(Proc)
|
142
|
-
proc_or_segment.call
|
141
|
+
proc_or_segment.call
|
143
142
|
else
|
144
143
|
SpanEventPrimitive.for_segment(proc_or_segment)
|
145
144
|
end
|
@@ -148,7 +147,6 @@ module NewRelic::Agent
|
|
148
147
|
def transform proc_or_segment
|
149
148
|
Span.new Transformer.transform(span_event proc_or_segment)
|
150
149
|
end
|
151
|
-
|
152
150
|
end
|
153
151
|
end
|
154
152
|
end
|
@@ -3,8 +3,8 @@
|
|
3
3
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
# frozen_string_literal: true
|
5
5
|
|
6
|
-
# The SuspendedStreamingBuffer class discards pushed segments and records
|
7
|
-
# the seen metric. This buffer is installed when the gRPC server returns
|
6
|
+
# The SuspendedStreamingBuffer class discards pushed segments and records
|
7
|
+
# the seen metric. This buffer is installed when the gRPC server returns
|
8
8
|
# UNIMPLEMENTED (status 12) code as a signal to not reconnect to the server.
|
9
9
|
module NewRelic::Agent
|
10
10
|
module InfiniteTracing
|
@@ -30,7 +30,7 @@ module NewRelic::Agent
|
|
30
30
|
# NOOP
|
31
31
|
end
|
32
32
|
alias :flush_queue :close_queue
|
33
|
-
|
33
|
+
|
34
34
|
def enumerator
|
35
35
|
@empty_buffer
|
36
36
|
end
|
@@ -25,15 +25,15 @@ module NewRelic::Agent
|
|
25
25
|
TrueClass => :bool_value,
|
26
26
|
FalseClass => :bool_value,
|
27
27
|
Integer => :int_value,
|
28
|
-
Float => :double_value
|
28
|
+
Float => :double_value
|
29
29
|
}
|
30
30
|
if RUBY_VERSION < '2.4.0'
|
31
31
|
KLASS_TO_ARG[Fixnum] = :int_value
|
32
32
|
end
|
33
33
|
if defined? BigDecimal
|
34
|
-
KLASS_TO_ARG[BigDecimal] = :double_value
|
34
|
+
KLASS_TO_ARG[BigDecimal] = :double_value
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
def safe_param_name value
|
38
38
|
KLASS_TO_ARG[value.class] || raise("Unhandled class #{value.class.name}")
|
39
39
|
end
|
@@ -51,4 +51,4 @@ module NewRelic::Agent
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
54
|
-
end
|
54
|
+
end
|
@@ -4,12 +4,11 @@
|
|
4
4
|
# frozen_string_literal: true
|
5
5
|
|
6
6
|
# The Worker class makes it easy to stop and start a thread at will.
|
7
|
-
# Some basic error handling/capture is wrapped around the Thread to help
|
7
|
+
# Some basic error handling/capture is wrapped around the Thread to help
|
8
8
|
# propagate the exceptions arising from the threaded processes to the main process
|
9
9
|
# where the main agent code lives.
|
10
10
|
module NewRelic::Agent
|
11
11
|
module InfiniteTracing
|
12
|
-
|
13
12
|
class Worker
|
14
13
|
attr_reader :name, :error
|
15
14
|
|
@@ -34,14 +33,14 @@ module NewRelic::Agent
|
|
34
33
|
!!@error
|
35
34
|
end
|
36
35
|
|
37
|
-
def join timeout=nil
|
36
|
+
def join timeout = nil
|
38
37
|
return unless @worker_thread
|
39
38
|
NewRelic::Agent.logger.debug "joining worker #{@name} thread..."
|
40
|
-
@worker_thread.join timeout
|
39
|
+
@worker_thread.join timeout
|
41
40
|
end
|
42
41
|
|
43
42
|
def stop
|
44
|
-
@lock.synchronize do
|
43
|
+
@lock.synchronize do
|
45
44
|
return unless @worker_thread
|
46
45
|
NewRelic::Agent.logger.debug "stopping worker #{@name} thread..."
|
47
46
|
@worker_thread.kill
|
@@ -69,6 +68,5 @@ module NewRelic::Agent
|
|
69
68
|
end
|
70
69
|
end
|
71
70
|
end
|
72
|
-
|
73
71
|
end
|
74
|
-
end
|
72
|
+
end
|
data/lib/infinite_tracing.rb
CHANGED
@@ -12,7 +12,6 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
12
12
|
require 'new_relic/version'
|
13
13
|
|
14
14
|
Gem::Specification.new do |s|
|
15
|
-
|
16
15
|
def self.copy_files filelist
|
17
16
|
subfolder = File.expand_path File.dirname(__FILE__)
|
18
17
|
|
@@ -25,7 +24,7 @@ Gem::Specification.new do |s|
|
|
25
24
|
|
26
25
|
shared_files = [
|
27
26
|
"../LICENSE",
|
28
|
-
"../CONTRIBUTING.md"
|
27
|
+
"../CONTRIBUTING.md"
|
29
28
|
]
|
30
29
|
|
31
30
|
self.copy_files shared_files
|
@@ -34,8 +33,7 @@ Gem::Specification.new do |s|
|
|
34
33
|
s.version = NewRelic::VERSION::STRING
|
35
34
|
s.required_ruby_version = '>= 2.5.0'
|
36
35
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
37
|
-
s.authors = [
|
38
|
-
s.date = Time.now.strftime('%Y-%m-%d')
|
36
|
+
s.authors = ["Tanna McClure", "Kayla Reopelle"]
|
39
37
|
s.licenses = ['Apache-2.0']
|
40
38
|
s.description = <<-EOS
|
41
39
|
The New Relic Ruby agent requires the gem newrelic_rpm, and it includes distributed
|
@@ -50,7 +48,7 @@ Inc (http://www.newrelic.com). New Relic provides you with deep
|
|
50
48
|
information about the performance of your web application as it runs
|
51
49
|
in production. The New Relic Ruby Agent is dual-purposed as a either a
|
52
50
|
Gem or plugin, hosted on https://github.com/newrelic/newrelic-ruby-agent/
|
53
|
-
EOS
|
51
|
+
EOS
|
54
52
|
|
55
53
|
s.email = "support@newrelic.com"
|
56
54
|
s.executables = []
|
@@ -60,11 +58,11 @@ EOS
|
|
60
58
|
]
|
61
59
|
|
62
60
|
s.metadata = {
|
63
|
-
'bug_tracker_uri'
|
64
|
-
'changelog_uri'
|
61
|
+
'bug_tracker_uri' => 'https://github.com/newrelic/newrelic-ruby-agent/issues',
|
62
|
+
'changelog_uri' => 'https://github.com/newrelic/newrelic-ruby-agent/blob/main/infinite_tracing/CHANGELOG.md',
|
65
63
|
'documentation_uri' => 'https://docs.newrelic.com/docs/agents/ruby-agent',
|
66
|
-
'source_code_uri'
|
67
|
-
"homepage_uri"
|
64
|
+
'source_code_uri' => 'https://github.com/newrelic/newrelic-ruby-agent',
|
65
|
+
"homepage_uri" => "https://newrelic.com/products/edge-infinite-tracing"
|
68
66
|
}
|
69
67
|
|
70
68
|
file_list = `git ls-files . -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/(?!agent_helper.rb)}) }
|
@@ -79,8 +77,8 @@ EOS
|
|
79
77
|
s.add_dependency 'grpc', '~> 1.34'
|
80
78
|
|
81
79
|
s.add_development_dependency 'rake', '12.3.3'
|
82
|
-
s.add_development_dependency 'rb-inotify', '0.9.10'
|
83
|
-
s.add_development_dependency 'listen', '3.0.8'
|
80
|
+
s.add_development_dependency 'rb-inotify', '0.9.10' # locked to support < Ruby 2.3 (and listen 3.0.8)
|
81
|
+
s.add_development_dependency 'listen', '3.0.8' # locked to support < Ruby 2.3
|
84
82
|
s.add_development_dependency 'minitest', '~> 5.14.0'
|
85
83
|
s.add_development_dependency 'mocha', '~> 1.9.0'
|
86
84
|
s.add_development_dependency 'pry-nav', '~> 0.3.0'
|
data/tasks/all.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
3
|
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
4
|
|
5
|
-
# This is required to load in task definitions
|
6
|
-
Dir.glob(File.join(File.dirname(__FILE__),'*.rake')) do |file|
|
5
|
+
# This is required to load in task definitions
|
6
|
+
Dir.glob(File.join(File.dirname(__FILE__), '*.rake')) do |file|
|
7
7
|
load file
|
8
8
|
end
|
data/tasks/proto.rake
CHANGED
@@ -20,7 +20,7 @@ namespace :proto do
|
|
20
20
|
license_terms = extract_license_terms File.readlines(File.join(gemspec_path, "Gemfile"))
|
21
21
|
Dir.glob(File.join output_path, "*.rb") do |filename|
|
22
22
|
contents = File.readlines filename
|
23
|
-
contents.reject!{|r| r =~ /^\s*require\s.*$/}
|
23
|
+
contents.reject! { |r| r =~ /^\s*require\s.*$/ }
|
24
24
|
File.open(filename, 'w') do |output|
|
25
25
|
output.puts license_terms
|
26
26
|
output.puts contents
|
@@ -47,5 +47,4 @@ namespace :proto do
|
|
47
47
|
puts "Failed to generate proto file."
|
48
48
|
end
|
49
49
|
end
|
50
|
-
|
51
50
|
end
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic-infinite_tracing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Aaron Huntsman
|
8
7
|
- Tanna McClure
|
9
|
-
-
|
8
|
+
- Kayla Reopelle
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: newrelic_rpm
|
@@ -18,14 +17,14 @@ dependencies:
|
|
18
17
|
requirements:
|
19
18
|
- - '='
|
20
19
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
20
|
+
version: 8.3.0
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
24
|
requirements:
|
26
25
|
- - '='
|
27
26
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
27
|
+
version: 8.3.0
|
29
28
|
- !ruby/object:Gem::Dependency
|
30
29
|
name: grpc
|
31
30
|
requirement: !ruby/object:Gem::Requirement
|