From 38aa6cde40186857f2b48f5a5bb0e8c00462f319 Mon Sep 17 00:00:00 2001 From: Arjun Rajappa Date: Tue, 6 Jan 2026 09:49:22 +0530 Subject: [PATCH 1/3] chore: start testing on ruby 4.0 release Signed-off-by: Arjun Rajappa --- .circleci/config.yml | 10 +++++----- instana.gemspec | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) 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 From 99c11d7e8a95d4115b189a73163919e1689a8080 Mon Sep 17 00:00:00 2001 From: Arjun Rajappa Date: Tue, 6 Jan 2026 12:32:02 +0530 Subject: [PATCH 2/3] test: fix failing tests and lint Signed-off-by: Arjun Rajappa --- lib/instana/trace/span.rb | 12 ++++++------ test/instrumentation/rest_client_test.rb | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/instana/trace/span.rb b/lib/instana/trace/span.rb index 52543bed..88dca881 100644 --- a/lib/instana/trace/span.rb +++ b/lib/instana/trace/span.rb @@ -83,13 +83,13 @@ def add_stack(limit: 30, stack: Kernel.caller) @attributes[:stack] = stack .map do |call| - file, line, *method = call.split(':') + file, line, *method = call.split(':') - { - c: file, - n: line, - m: method.join(' ') - } + { + c: file, + n: line, + m: method.join(' ') + } end.take(limit > 40 ? 40 : limit) end 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 From d33094385ea5874d6b5876bdfc2160e899fb8146 Mon Sep 17 00:00:00 2001 From: Arjun Rajappa Date: Mon, 12 Jan 2026 09:33:07 +0530 Subject: [PATCH 3/3] chore: refactor ternary statement to use min function Signed-off-by: Arjun Rajappa --- lib/instana/trace/span.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/instana/trace/span.rb b/lib/instana/trace/span.rb index 88dca881..c8d64ddf 100644 --- a/lib/instana/trace/span.rb +++ b/lib/instana/trace/span.rb @@ -90,7 +90,7 @@ def add_stack(limit: 30, stack: Kernel.caller) n: line, m: method.join(' ') } - end.take(limit > 40 ? 40 : limit) + end.take([limit, 40].min) end # Log an error into the span