-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite Tracing: batching and compression #1723
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,12 @@ | |
module NewRelic::Agent | ||
module InfiniteTracing | ||
class Connection | ||
GZIP_METADATA = {'grpc-internal-encoding-request' => 'gzip', | ||
'grpc-encoding' => 'gzip', | ||
'grpc-accept-encoding' => ['gzip'], | ||
'content-coding' => 'gzip', | ||
'content-encoding' => 'gzip'}.freeze | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To align with our gist, use gzip specific metadata. |
||
|
||
# listens for server side configurations added to the agent. When a new config is | ||
# added, we have a new agent run token and need to restart the client's RPC stream | ||
# with the new metadata information. | ||
|
@@ -100,9 +106,18 @@ def metadata | |
"agent_run_token" => agent_id | ||
} | ||
@metadata.merge!(request_headers_map) | ||
merge_gzip_metadata | ||
end | ||
end | ||
|
||
# If (gzip based) compression is enabled, explicitly provide all | ||
# relevant metadata | ||
def merge_gzip_metadata | ||
return @metadata unless Config.compression_enabled? | ||
|
||
@metadata.merge!(GZIP_METADATA) | ||
end | ||
|
||
# Initializes rpc so we can get a Channel and Stub (connect to gRPC server) | ||
# Initializes metadata so we use newest values in establishing channel | ||
# Sets the agent_connected flag and signals the agent started so any | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2317,21 +2317,21 @@ def self.enforce_fallback(allowed_values: nil, fallback: nil) | |
}, | ||
:'infinite_tracing.batching' => { | ||
:default => false, | ||
:public => false, | ||
:public => true, | ||
:type => Boolean, | ||
:allowed_from_server => false, | ||
:external => :infinite_tracing, | ||
:description => "If true, data sent to the Trace Observer will be batched instead of the default of each " \ | ||
:description => "If true (the default), data sent to the Trace Observer will be batched\ninstead of each " \ | ||
"span being sent individually" | ||
}, | ||
:'infinite_tracing.compression_level' => { | ||
:default => :none, | ||
:public => false, | ||
:default => :high, | ||
:public => true, | ||
:type => Symbol, | ||
:allowed_from_server => false, | ||
:external => :infinite_tracing, | ||
:description => "Configure the compression level for data sent to the Trace Observer\nMay be one of " \ | ||
"[none|low|medium|high]\nBy default, compression is not used (level = none)" | ||
"[none|low|medium|high]\n'high' is the default. Set the level to 'none' to disable compression" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make the settings public, and with the first public offering have the defaults be compression high, batching enabled. (See SWAG doc for details) |
||
}, | ||
:js_agent_file => { | ||
:default => '', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the content removed from this
channel.rb
file was simply moved toconfig.rb
, as it is more appropriate to be considered configuration related.Before this PR, everyone got both
enable_deadline_checking' => 0
andminimal_stack' => 1
. Nowminimal_stack => 1
is not used when compression is desired, as we have learned it will disable compression.