lib/sentry/client.rb in sentry-ruby-5.19.0 vs lib/sentry/client.rb in sentry-ruby-5.20.0

- old
+ new

@@ -28,11 +28,11 @@ if transport_class = configuration.transport.transport_class @transport = transport_class.new(configuration) else @transport = case configuration.dsn&.scheme - when 'http', 'https' + when "http", "https" HTTPTransport.new(configuration) else DummyTransport.new(configuration) end end @@ -47,11 +47,11 @@ # @return [Event, nil] def capture_event(event, scope, hint = {}) return unless configuration.sending_allowed? if event.is_a?(ErrorEvent) && !configuration.sample_allowed? - transport.record_lost_event(:sample_rate, 'error') + transport.record_lost_event(:sample_rate, "error") return end event_type = event.is_a?(Event) ? event.type : event["type"] data_category = Envelope::Item.data_category(event_type) @@ -62,23 +62,23 @@ event = scope.apply_to_event(event, hint) if event.nil? log_debug("Discarded event because one of the event processors returned nil") transport.record_lost_event(:event_processor, data_category) - transport.record_lost_event(:event_processor, 'span', num: spans_before + 1) if is_transaction + transport.record_lost_event(:event_processor, "span", num: spans_before + 1) if is_transaction return elsif is_transaction spans_delta = spans_before - event.spans.size - transport.record_lost_event(:event_processor, 'span', num: spans_delta) if spans_delta > 0 + transport.record_lost_event(:event_processor, "span", num: spans_delta) if spans_delta > 0 end if async_block = configuration.async dispatch_async_event(async_block, event, hint) elsif configuration.background_worker_threads != 0 && hint.fetch(:background, true) unless dispatch_background_event(event, hint) transport.record_lost_event(:queue_overflow, data_category) - transport.record_lost_event(:queue_overflow, 'span', num: spans_before + 1) if is_transaction + transport.record_lost_event(:queue_overflow, "span", num: spans_before + 1) if is_transaction end else send_event(event, hint) end @@ -193,27 +193,27 @@ if event_type == TransactionEvent::TYPE && configuration.before_send_transaction event = configuration.before_send_transaction.call(event, hint) if event.nil? log_debug("Discarded event because before_send_transaction returned nil") - transport.record_lost_event(:before_send, 'transaction') - transport.record_lost_event(:before_send, 'span', num: spans_before + 1) + transport.record_lost_event(:before_send, "transaction") + transport.record_lost_event(:before_send, "span", num: spans_before + 1) return else spans_after = event.is_a?(TransactionEvent) ? event.spans.size : 0 spans_delta = spans_before - spans_after - transport.record_lost_event(:before_send, 'span', num: spans_delta) if spans_delta > 0 + transport.record_lost_event(:before_send, "span", num: spans_delta) if spans_delta > 0 end end transport.send_event(event) if configuration.sending_to_dsn_allowed? spotlight_transport.send_event(event) if spotlight_transport event rescue => e log_error("Event sending failed", e, debug: configuration.debug) transport.record_lost_event(:network_error, data_category) - transport.record_lost_event(:network_error, 'span', num: spans_before + 1) if event.is_a?(TransactionEvent) + transport.record_lost_event(:network_error, "span", num: spans_before + 1) if event.is_a?(TransactionEvent) raise end # Send an envelope directly to Sentry. # @param envelope [Envelope] the envelope to be sent.