diff --git a/lib/scout_apm/layer_converters/request_queue_time_converter.rb b/lib/scout_apm/layer_converters/request_queue_time_converter.rb index e985b5be..933a6726 100644 --- a/lib/scout_apm/layer_converters/request_queue_time_converter.rb +++ b/lib/scout_apm/layer_converters/request_queue_time_converter.rb @@ -15,6 +15,9 @@ def record! return unless headers + # When an application uses Turbo Streams, we capture very innaccurate queue times. + return if request_over_websocket? + raw_start = locate_timestamp return unless raw_start @@ -38,6 +41,10 @@ def record! private + def request_over_websocket? + headers["Upgrade"] == "websocket" + end + # Looks through the possible headers with this data, and extracts the raw # value of the header # Returns nil if not found