diff --git a/.circleci/config.yml b/.circleci/config.yml index 5400178e..1269bdda 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -279,7 +279,7 @@ workflows: - "3.2" - "3.3" - "3.4" - - "3.5.0-preview1" + - "4.0" libraries_ruby_31_32: jobs: - test_apprisal: @@ -304,7 +304,7 @@ workflows: ruby_version: - "3.3" - "3.4" - - "3.5.0-preview1" + - "4.0" # Currently compiling the native extensions for `grpc` # exceeds an internal RAM and/or CPU limit of CircleCI executor, # and the job gets terminated with: @@ -314,7 +314,7 @@ workflows: # on https://rubygems.org/gems/grpc/versions exclude: - stack: base - ruby_version: "3.5.0-preview1" + ruby_version: "4.0" gemfile: "./gemfiles/grpc_10.gemfile" rails_ruby_31_35: jobs: @@ -335,7 +335,7 @@ workflows: - "3.2" - "3.3" - "3.4" - - "3.5.0-preview1" + - "4.0" rails8_ruby_33_35: jobs: - test_apprisal: @@ -369,7 +369,7 @@ workflows: - "3.1" - "3.2" - "3.3" - - "3.5.0-preview1" + - "4.0" report_coverage: jobs: - report_coverage diff --git a/instana.gemspec b/instana.gemspec index 08715f53..6ccbaa3c 100644 --- a/instana.gemspec +++ b/instana.gemspec @@ -48,5 +48,6 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency('sys-proctable', '>= 1.2.2') spec.add_runtime_dependency('opentelemetry-api', '~> 1.4') spec.add_runtime_dependency('opentelemetry-common') + spec.add_runtime_dependency('cgi') spec.add_runtime_dependency('oj', '>=3.0.11') unless RUBY_PLATFORM =~ /java/i end diff --git a/lib/instana/trace/span.rb b/lib/instana/trace/span.rb index 52543bed..c8d64ddf 100644 --- a/lib/instana/trace/span.rb +++ b/lib/instana/trace/span.rb @@ -83,14 +83,14 @@ def add_stack(limit: 30, stack: Kernel.caller) @attributes[:stack] = stack .map do |call| - file, line, *method = call.split(':') - - { - c: file, - n: line, - m: method.join(' ') - } - end.take(limit > 40 ? 40 : limit) + file, line, *method = call.split(':') + + { + c: file, + n: line, + m: method.join(' ') + } + end.take([limit, 40].min) end # Log an error into the span diff --git a/test/instrumentation/rest_client_test.rb b/test/instrumentation/rest_client_test.rb index 1ae33a29..0ec6b0d0 100644 --- a/test/instrumentation/rest_client_test.rb +++ b/test/instrumentation/rest_client_test.rb @@ -7,7 +7,7 @@ class RestClientTest < Minitest::Test def setup # See https://github.com/rest-client/rest-client/issues/612 - OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ciphers] = OpenSSL::SSL::SSLContext.new.ciphers + OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ciphers] = OpenSSL::SSL::SSLContext.new.ciphers if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('4.0') end def teardown