Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
petethepig committed Aug 6, 2022
1 parent e169f5e commit 0a2ea31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pyroscope_ffi/ruby/lib/pyroscope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ module Utils

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
def initialize(*)
super
# defaults:
self.application_name = ''
self.server_address = 'http://localhost:4040'
self.auth_token = ''
Expand All @@ -35,7 +37,6 @@ def initialize(*)
self.log_level = 'error'
self.tags = {}
self.compression = 'gzip'
super
end
end

Expand Down Expand Up @@ -68,6 +69,7 @@ def configure

# initialize Pyroscope Agent
Rust.initialize_agent(
# these are defaults in case user-provided values are nil:
@config.app_name || @config.application_name || "",
@config.server_address || "",
@config.auth_token || "",
Expand Down
2 changes: 1 addition & 1 deletion src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl Session {
let body = match &self.config.compression {
None => report_u8,
Some(Compression::GZIP) => {
req_builder = req_builder.header("Content-encoding", "gzip");
req_builder = req_builder.header("Content-Encoding", "gzip");
let mut encoder = Encoder::new(Vec::new()).unwrap();
encoder.write_all(&report_u8).unwrap();
encoder.finish().into_result().unwrap()
Expand Down

0 comments on commit 0a2ea31

Please sign in to comment.