Skip to content

Commit 0a2ea31

Browse files
committed
small fixes
1 parent e169f5e commit 0a2ea31

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pyroscope_ffi/ruby/lib/pyroscope.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ module Utils
2424

2525
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 = ''
@@ -35,7 +37,6 @@ def initialize(*)
3537
self.log_level = 'error'
3638
self.tags = {}
3739
self.compression = 'gzip'
38-
super
3940
end
4041
end
4142

@@ -68,6 +69,7 @@ def configure
6869

6970
# initialize Pyroscope Agent
7071
Rust.initialize_agent(
72+
# these are defaults in case user-provided values are nil:
7173
@config.app_name || @config.application_name || "",
7274
@config.server_address || "",
7375
@config.auth_token || "",

src/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl Session {
197197
let body = match &self.config.compression {
198198
None => report_u8,
199199
Some(Compression::GZIP) => {
200-
req_builder = req_builder.header("Content-encoding", "gzip");
200+
req_builder = req_builder.header("Content-Encoding", "gzip");
201201
let mut encoder = Encoder::new(Vec::new()).unwrap();
202202
encoder.write_all(&report_u8).unwrap();
203203
encoder.finish().into_result().unwrap()

0 commit comments

Comments
 (0)