@@ -8,7 +8,7 @@ module Rust
88 extend FFI ::Library
99 ffi_lib File . expand_path ( File . dirname ( __FILE__ ) ) + "/rbspy/rbspy.#{ RbConfig ::CONFIG [ "DLEXT" ] } "
1010 attach_function :initialize_logging , [ :int ] , :bool
11- attach_function :initialize_agent , [ :string , :string , :string , :int , :bool , :bool , :bool , :bool , :string ] , :bool
11+ attach_function :initialize_agent , [ :string , :string , :string , :int , :bool , :bool , :bool , :bool , :string , :string ] , :bool
1212 attach_function :add_thread_tag , [ :uint64 , :string , :string ] , :bool
1313 attach_function :remove_thread_tag , [ :uint64 , :string , :string ] , :bool
1414 attach_function :add_global_tag , [ :string , :string ] , :bool
@@ -22,8 +22,10 @@ module Utils
2222 attach_function :thread_id , [ ] , :uint64
2323 end
2424
25- Config = Struct . new ( :application_name , :app_name , :server_address , :auth_token , :log_level , :sample_rate , :detect_subprocesses , :oncpu , :report_pid , :report_thread_id , :tags ) do
25+ Config = Struct . new ( :application_name , :app_name , :server_address , :auth_token , :log_level , :sample_rate , :detect_subprocesses , :oncpu , :report_pid , :report_thread_id , :tags , :compression ) do
2626 def initialize ( *)
27+ super
28+ # defaults:
2729 self . application_name = ''
2830 self . server_address = 'http://localhost:4040'
2931 self . auth_token = ''
@@ -34,7 +36,7 @@ def initialize(*)
3436 self . report_thread_id = false
3537 self . log_level = 'error'
3638 self . tags = { }
37- super
39+ self . compression = 'gzip'
3840 end
3941 end
4042
@@ -63,10 +65,11 @@ def configure
6365
6466 # Initialize Logging
6567 Rust . initialize_logging ( @log_level )
66-
68+
6769
6870 # initialize Pyroscope Agent
6971 Rust . initialize_agent (
72+ # these are defaults in case user-provided values are nil:
7073 @config . app_name || @config . application_name || "" ,
7174 @config . server_address || "" ,
7275 @config . auth_token || "" ,
@@ -75,7 +78,8 @@ def configure
7578 @config . oncpu || false ,
7679 @config . report_pid || false ,
7780 @config . report_thread_id || false ,
78- tags_to_string ( @config . tags || { } )
81+ tags_to_string ( @config . tags || { } ) ,
82+ @config . compression || ""
7983 )
8084 end
8185
0 commit comments