Skip to content

Commit c534ee5

Browse files
committed
Apply some manual adjustments
1 parent 8c85320 commit c534ee5

File tree

5 files changed

+38
-33
lines changed

5 files changed

+38
-33
lines changed

sentry-opentelemetry/lib/sentry/opentelemetry/propagator.rb

+9-8
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@ def extract(
5050

5151
baggage_header = getter.get(carrier, BAGGAGE_HEADER_NAME)
5252

53-
baggage = if baggage_header && !baggage_header.empty?
54-
Baggage.from_incoming_header(baggage_header)
55-
else
56-
# If there's an incoming sentry-trace but no incoming baggage header,
57-
# for instance in traces coming from older SDKs,
58-
# baggage will be empty and frozen and won't be populated as head SDK.
59-
Baggage.new({})
60-
end
53+
baggage =
54+
if baggage_header && !baggage_header.empty?
55+
Baggage.from_incoming_header(baggage_header)
56+
else
57+
# If there's an incoming sentry-trace but no incoming baggage header,
58+
# for instance in traces coming from older SDKs,
59+
# baggage will be empty and frozen and won't be populated as head SDK.
60+
Baggage.new({})
61+
end
6162

6263
baggage.freeze!
6364
context = context.set_value(SENTRY_BAGGAGE_KEY, baggage)

sentry-rails/lib/sentry/rails/tracing/active_record_subscriber.rb

+6-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ def self.subscribe!
2727

2828
next unless connection
2929

30-
db_config = if connection.pool.respond_to?(:db_config)
31-
connection.pool.db_config.configuration_hash
32-
elsif connection.pool.respond_to?(:spec)
33-
connection.pool.spec.config
34-
end
30+
db_config =
31+
if connection.pool.respond_to?(:db_config)
32+
connection.pool.db_config.configuration_hash
33+
elsif connection.pool.respond_to?(:spec)
34+
connection.pool.spec.config
35+
end
3536

3637
next unless db_config
3738

sentry-ruby/lib/sentry/propagation_context.rb

+9-8
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@ def initialize(scope, env = nil)
5050
if sentry_trace_data
5151
@trace_id, @parent_span_id, @parent_sampled = sentry_trace_data
5252

53-
@baggage = if baggage_header && !baggage_header.empty?
54-
Baggage.from_incoming_header(baggage_header)
55-
else
56-
# If there's an incoming sentry-trace but no incoming baggage header,
57-
# for instance in traces coming from older SDKs,
58-
# baggage will be empty and frozen and won't be populated as head SDK.
59-
Baggage.new({})
60-
end
53+
@baggage =
54+
if baggage_header && !baggage_header.empty?
55+
Baggage.from_incoming_header(baggage_header)
56+
else
57+
# If there's an incoming sentry-trace but no incoming baggage header,
58+
# for instance in traces coming from older SDKs,
59+
# baggage will be empty and frozen and won't be populated as head SDK.
60+
Baggage.new({})
61+
end
6162

6263
@baggage.freeze!
6364
@incoming_trace = true

sentry-ruby/lib/sentry/transaction.rb

+9-8
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,15 @@ def self.from_sentry_trace(sentry_trace, baggage: nil, hub: Sentry.get_current_h
110110

111111
trace_id, parent_span_id, parent_sampled = sentry_trace_data
112112

113-
baggage = if baggage && !baggage.empty?
114-
Baggage.from_incoming_header(baggage)
115-
else
116-
# If there's an incoming sentry-trace but no incoming baggage header,
117-
# for instance in traces coming from older SDKs,
118-
# baggage will be empty and frozen and won't be populated as head SDK.
119-
Baggage.new({})
120-
end
113+
baggage =
114+
if baggage && !baggage.empty?
115+
Baggage.from_incoming_header(baggage)
116+
else
117+
# If there's an incoming sentry-trace but no incoming baggage header,
118+
# for instance in traces coming from older SDKs,
119+
# baggage will be empty and frozen and won't be populated as head SDK.
120+
Baggage.new({})
121+
end
121122

122123
baggage.freeze!
123124

sentry-sidekiq/lib/sentry/sidekiq-scheduler/scheduler.rb

+5-4
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ def new_job(name, interval_type, config, schedule, options)
3535
# For cron, every, or interval jobs — grab their schedule.
3636
# Rufus::Scheduler::EveryJob stores it's frequency in seconds,
3737
# so we convert it to minutes before passing in to the monitor.
38-
monitor_config = case interval_type
39-
when "cron"
38+
monitor_config =
39+
case interval_type
40+
when "cron"
4041
# fugit is a second order dependency of sidekiq-scheduler via rufus-scheduler
4142
parsed_cron = ::Fugit.parse_cron(schedule)
4243
timezone = parsed_cron.timezone
@@ -50,9 +51,9 @@ def new_job(name, interval_type, config, schedule, options)
5051
else
5152
Sentry::Cron::MonitorConfig.from_crontab(schedule)
5253
end
53-
when "every", "interval"
54+
when "every", "interval"
5455
Sentry::Cron::MonitorConfig.from_interval(rufus_job.frequency.to_i / 60, :minute)
55-
end
56+
end
5657

5758
# If we couldn't build a monitor config, it's either an error, or
5859
# it's a one-time job (interval_type is in, or at), in which case

0 commit comments

Comments
 (0)