From 93895a1ebf56e751fc6a1b4ec6e9f0aaec96fc12 Mon Sep 17 00:00:00 2001 From: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:22:41 -0800 Subject: [PATCH 01/20] chore: bump rubocop from 1.70.0 to 1.71.0 (#1365) --- Gemfile | 2 +- helpers/mysql/opentelemetry-helpers-mysql.gemspec | 2 +- .../opentelemetry-helpers-sql-obfuscation.gemspec | 2 +- .../opentelemetry-instrumentation-action_mailer.gemspec | 2 +- .../opentelemetry-instrumentation-action_pack.gemspec | 2 +- .../opentelemetry-instrumentation-action_view.gemspec | 2 +- .../active_job/opentelemetry-instrumentation-active_job.gemspec | 2 +- ...entelemetry-instrumentation-active_model_serializers.gemspec | 2 +- .../opentelemetry-instrumentation-active_record.gemspec | 2 +- .../opentelemetry-instrumentation-active_support.gemspec | 2 +- instrumentation/all/opentelemetry-instrumentation-all.gemspec | 2 +- .../aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec | 2 +- .../aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec | 2 +- instrumentation/base/opentelemetry-instrumentation-base.gemspec | 2 +- .../bunny/opentelemetry-instrumentation-bunny.gemspec | 2 +- .../opentelemetry-instrumentation-concurrent_ruby.gemspec | 2 +- .../dalli/opentelemetry-instrumentation-dalli.gemspec | 2 +- .../opentelemetry-instrumentation-delayed_job.gemspec | 2 +- .../ethon/opentelemetry-instrumentation-ethon.gemspec | 2 +- .../excon/opentelemetry-instrumentation-excon.gemspec | 2 +- .../faraday/opentelemetry-instrumentation-faraday.gemspec | 2 +- .../grape/opentelemetry-instrumentation-grape.gemspec | 2 +- .../graphql/opentelemetry-instrumentation-graphql.gemspec | 2 +- instrumentation/grpc/opentelemetry-instrumentation-grpc.gemspec | 2 +- instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec | 2 +- instrumentation/http/opentelemetry-instrumentation-http.gemspec | 2 +- .../opentelemetry-instrumentation-http_client.gemspec | 2 +- .../httpx/opentelemetry-instrumentation-httpx.gemspec | 2 +- .../koala/opentelemetry-instrumentation-koala.gemspec | 2 +- instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec | 2 +- .../mongo/opentelemetry-instrumentation-mongo.gemspec | 2 +- .../mysql2/opentelemetry-instrumentation-mysql2.gemspec | 2 +- .../net_http/opentelemetry-instrumentation-net_http.gemspec | 2 +- instrumentation/pg/opentelemetry-instrumentation-pg.gemspec | 2 +- instrumentation/que/opentelemetry-instrumentation-que.gemspec | 2 +- .../racecar/opentelemetry-instrumentation-racecar.gemspec | 2 +- instrumentation/rack/opentelemetry-instrumentation-rack.gemspec | 2 +- .../rails/opentelemetry-instrumentation-rails.gemspec | 2 +- instrumentation/rake/opentelemetry-instrumentation-rake.gemspec | 2 +- .../rdkafka/opentelemetry-instrumentation-rdkafka.gemspec | 2 +- .../redis/opentelemetry-instrumentation-redis.gemspec | 2 +- .../resque/opentelemetry-instrumentation-resque.gemspec | 2 +- .../restclient/opentelemetry-instrumentation-restclient.gemspec | 2 +- .../rspec/opentelemetry-instrumentation-rspec.gemspec | 2 +- .../ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec | 2 +- .../sidekiq/opentelemetry-instrumentation-sidekiq.gemspec | 2 +- .../sinatra/opentelemetry-instrumentation-sinatra.gemspec | 2 +- .../trilogy/opentelemetry-instrumentation-trilogy.gemspec | 2 +- processor/baggage/opentelemetry-processor-baggage.gemspec | 2 +- propagator/ottrace/opentelemetry-propagator-ottrace.gemspec | 2 +- propagator/vitess/opentelemetry-propagator-vitess.gemspec | 2 +- propagator/xray/opentelemetry-propagator-xray.gemspec | 2 +- resources/azure/opentelemetry-resource-detector-azure.gemspec | 2 +- .../container/opentelemetry-resource-detector-container.gemspec | 2 +- ...pentelemetry-resource-detector-google_cloud_platform.gemspec | 2 +- 55 files changed, 55 insertions(+), 55 deletions(-) diff --git a/Gemfile b/Gemfile index 02a839e1f..33d2ca7d7 100644 --- a/Gemfile +++ b/Gemfile @@ -7,5 +7,5 @@ source 'https://rubygems.org' gem 'rake', '~> 13.0' -gem 'rubocop', '~> 1.70.0' +gem 'rubocop', '~> 1.71.0' gem 'rubocop-performance', '~> 1.23.0' diff --git a/helpers/mysql/opentelemetry-helpers-mysql.gemspec b/helpers/mysql/opentelemetry-helpers-mysql.gemspec index 14e8d51d6..00d786041 100644 --- a/helpers/mysql/opentelemetry-helpers-mysql.gemspec +++ b/helpers/mysql/opentelemetry-helpers-mysql.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec b/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec index 56997cde6..4c6a73b76 100644 --- a/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec +++ b/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'yard', '~> 0.9' spec.add_development_dependency 'yard-doctest', '~> 0.1.6' diff --git a/instrumentation/action_mailer/opentelemetry-instrumentation-action_mailer.gemspec b/instrumentation/action_mailer/opentelemetry-instrumentation-action_mailer.gemspec index 42132ba1e..b315f5412 100644 --- a/instrumentation/action_mailer/opentelemetry-instrumentation-action_mailer.gemspec +++ b/instrumentation/action_mailer/opentelemetry-instrumentation-action_mailer.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/action_pack/opentelemetry-instrumentation-action_pack.gemspec b/instrumentation/action_pack/opentelemetry-instrumentation-action_pack.gemspec index cf460d4c8..23dcda624 100644 --- a/instrumentation/action_pack/opentelemetry-instrumentation-action_pack.gemspec +++ b/instrumentation/action_pack/opentelemetry-instrumentation-action_pack.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/action_view/opentelemetry-instrumentation-action_view.gemspec b/instrumentation/action_view/opentelemetry-instrumentation-action_view.gemspec index 8acf5927e..dfb773985 100644 --- a/instrumentation/action_view/opentelemetry-instrumentation-action_view.gemspec +++ b/instrumentation/action_view/opentelemetry-instrumentation-action_view.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rails', '>= 6.1' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/active_job/opentelemetry-instrumentation-active_job.gemspec b/instrumentation/active_job/opentelemetry-instrumentation-active_job.gemspec index c99354bf0..5952bc6c3 100644 --- a/instrumentation/active_job/opentelemetry-instrumentation-active_job.gemspec +++ b/instrumentation/active_job/opentelemetry-instrumentation-active_job.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/active_model_serializers/opentelemetry-instrumentation-active_model_serializers.gemspec b/instrumentation/active_model_serializers/opentelemetry-instrumentation-active_model_serializers.gemspec index e495226d9..ac719b790 100644 --- a/instrumentation/active_model_serializers/opentelemetry-instrumentation-active_model_serializers.gemspec +++ b/instrumentation/active_model_serializers/opentelemetry-instrumentation-active_model_serializers.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/active_record/opentelemetry-instrumentation-active_record.gemspec b/instrumentation/active_record/opentelemetry-instrumentation-active_record.gemspec index 2e9da062e..a58e2c04f 100644 --- a/instrumentation/active_record/opentelemetry-instrumentation-active_record.gemspec +++ b/instrumentation/active_record/opentelemetry-instrumentation-active_record.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/active_support/opentelemetry-instrumentation-active_support.gemspec b/instrumentation/active_support/opentelemetry-instrumentation-active_support.gemspec index 28eb57d38..956383e3f 100644 --- a/instrumentation/active_support/opentelemetry-instrumentation-active_support.gemspec +++ b/instrumentation/active_support/opentelemetry-instrumentation-active_support.gemspec @@ -38,7 +38,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry-byebug' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/all/opentelemetry-instrumentation-all.gemspec b/instrumentation/all/opentelemetry-instrumentation-all.gemspec index 4410f0f51..c3d46c7f3 100644 --- a/instrumentation/all/opentelemetry-instrumentation-all.gemspec +++ b/instrumentation/all/opentelemetry-instrumentation-all.gemspec @@ -66,7 +66,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec b/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec index ea2b3306c..6d1ed60e3 100644 --- a/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec +++ b/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry' spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec b/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec index f46e9cfc3..6c2f894d1 100644 --- a/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec +++ b/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry' spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/base/opentelemetry-instrumentation-base.gemspec b/instrumentation/base/opentelemetry-instrumentation-base.gemspec index 0362d3821..90edf29d0 100644 --- a/instrumentation/base/opentelemetry-instrumentation-base.gemspec +++ b/instrumentation/base/opentelemetry-instrumentation-base.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec b/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec index b6ae84d4d..b5b226983 100644 --- a/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec +++ b/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec b/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec index cb716de19..608f17c73 100644 --- a/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec +++ b/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec b/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec index be160889b..80ba31737 100644 --- a/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec +++ b/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec b/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec index 45cd0667b..aa4ef79aa 100644 --- a/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec +++ b/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'sqlite3' diff --git a/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec b/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec index 02a2b88a3..1b52907c5 100644 --- a/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec +++ b/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec b/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec index 5e58ae8b0..0d8af867d 100644 --- a/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec +++ b/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec b/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec index 08473582f..de4f07bb5 100644 --- a/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec +++ b/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec b/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec index 3aaabb1eb..a8fe134d6 100644 --- a/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec +++ b/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec @@ -38,7 +38,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rack-test' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec b/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec index 1522e3c6d..caab57867 100644 --- a/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec +++ b/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/grpc/opentelemetry-instrumentation-grpc.gemspec b/instrumentation/grpc/opentelemetry-instrumentation-grpc.gemspec index 03f19f1ba..5f6cf9cef 100644 --- a/instrumentation/grpc/opentelemetry-instrumentation-grpc.gemspec +++ b/instrumentation/grpc/opentelemetry-instrumentation-grpc.gemspec @@ -44,7 +44,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.4' spec.add_development_dependency 'rake', '~> 13.2' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec b/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec index 9539dc6be..0de2692dd 100644 --- a/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec +++ b/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.0' spec.add_development_dependency 'opentelemetry-test-helpers' spec.add_development_dependency 'rake', '~> 12.3.3' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/http/opentelemetry-instrumentation-http.gemspec b/instrumentation/http/opentelemetry-instrumentation-http.gemspec index a119c01e8..e07f8a4f4 100644 --- a/instrumentation/http/opentelemetry-instrumentation-http.gemspec +++ b/instrumentation/http/opentelemetry-instrumentation-http.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec b/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec index 5ad080a0e..85730d438 100644 --- a/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec +++ b/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec b/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec index faa6a03b5..e99741829 100644 --- a/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec +++ b/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec b/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec index a683139b7..bcc202389 100644 --- a/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec +++ b/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec b/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec index 899da6af5..059fc3de7 100644 --- a/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec +++ b/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec b/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec index 168ed8bef..51fd7d762 100644 --- a/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec +++ b/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry' spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec b/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec index ab1237e60..97584c0a3 100644 --- a/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec +++ b/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'pry' spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec b/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec index 29b4c37dd..729f5d04d 100644 --- a/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec +++ b/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0.1' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec index bdf72fc2d..8d01fe319 100644 --- a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec +++ b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'pry' spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/que/opentelemetry-instrumentation-que.gemspec b/instrumentation/que/opentelemetry-instrumentation-que.gemspec index c1f956ffe..759edd0d8 100644 --- a/instrumentation/que/opentelemetry-instrumentation-que.gemspec +++ b/instrumentation/que/opentelemetry-instrumentation-que.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec b/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec index d21928ff3..324305214 100644 --- a/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec +++ b/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec b/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec index bf428278e..04c6fbe58 100644 --- a/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec +++ b/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec index da8944322..6f6bd5a4f 100644 --- a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec +++ b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec @@ -42,7 +42,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rack-test', '~> 2.1.0' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec b/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec index bbcfaeb88..31a8e7b26 100644 --- a/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec +++ b/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.0' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec b/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec index 528b025bd..f126d964c 100644 --- a/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec +++ b/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec b/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec index e10577bcd..2b87e0966 100644 --- a/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec +++ b/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec b/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec index 40c99f530..a3b198e75 100644 --- a/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec +++ b/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec b/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec index 81dd65dc7..90d4fd330 100644 --- a/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec +++ b/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec b/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec index 51295a03c..f3b472fdd 100644 --- a/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec +++ b/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec b/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec index 7871f342f..f258a0b73 100644 --- a/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec +++ b/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec b/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec index fc8b65bdf..1c7092449 100644 --- a/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec +++ b/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec b/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec index 062b816f2..ed7f7dacb 100644 --- a/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec +++ b/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rack-test', '~> 2.1' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec b/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec index 8d796fbd9..98999a9d8 100644 --- a/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec +++ b/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec @@ -41,7 +41,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rspec-mocks' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17.1' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/processor/baggage/opentelemetry-processor-baggage.gemspec b/processor/baggage/opentelemetry-processor-baggage.gemspec index 118f45f19..7c2337be3 100644 --- a/processor/baggage/opentelemetry-processor-baggage.gemspec +++ b/processor/baggage/opentelemetry-processor-baggage.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/propagator/ottrace/opentelemetry-propagator-ottrace.gemspec b/propagator/ottrace/opentelemetry-propagator-ottrace.gemspec index 367520f1f..44b27b6ce 100644 --- a/propagator/ottrace/opentelemetry-propagator-ottrace.gemspec +++ b/propagator/ottrace/opentelemetry-propagator-ottrace.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/propagator/vitess/opentelemetry-propagator-vitess.gemspec b/propagator/vitess/opentelemetry-propagator-vitess.gemspec index 348c737bf..9b7018ce7 100644 --- a/propagator/vitess/opentelemetry-propagator-vitess.gemspec +++ b/propagator/vitess/opentelemetry-propagator-vitess.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/propagator/xray/opentelemetry-propagator-xray.gemspec b/propagator/xray/opentelemetry-propagator-xray.gemspec index 9ba9e6784..b9f0d3c40 100644 --- a/propagator/xray/opentelemetry-propagator-xray.gemspec +++ b/propagator/xray/opentelemetry-propagator-xray.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/resources/azure/opentelemetry-resource-detector-azure.gemspec b/resources/azure/opentelemetry-resource-detector-azure.gemspec index 19189d3da..ad133a8a1 100644 --- a/resources/azure/opentelemetry-resource-detector-azure.gemspec +++ b/resources/azure/opentelemetry-resource-detector-azure.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17' spec.add_development_dependency 'webmock', '~> 3.24.0' diff --git a/resources/container/opentelemetry-resource-detector-container.gemspec b/resources/container/opentelemetry-resource-detector-container.gemspec index a390590ce..c97a631d0 100644 --- a/resources/container/opentelemetry-resource-detector-container.gemspec +++ b/resources/container/opentelemetry-resource-detector-container.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec b/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec index 56cdced6d..6f3102bc9 100644 --- a/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec +++ b/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' spec.add_development_dependency 'simplecov', '~> 0.17' spec.add_development_dependency 'webmock', '~> 3.24.0' From fee95c6c31ce68cb12b895ea192899cdcea177b8 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Fri, 24 Jan 2025 15:26:50 -0600 Subject: [PATCH 02/20] feat: Initial Release SQL Helpers (#1263) * feat: Initial Release Sql Helpers provides support for other gems. This PR is focing on sharing database related attributes from a parent to a child context.. * squash: mispelling * squash: add some docs * squash: Apply suggestions from code review Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> * squash: update readme with feedback from Kayla --------- Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> --- .github/dependabot.yml | 4 + .github/workflows/ci-contrib.yml | 1 + .toys/.data/releases.yml | 4 + helpers/sql/.rubocop.yml | 1 + helpers/sql/.yardopts | 9 + helpers/sql/CHANGELOG.md | 1 + helpers/sql/Gemfile | 13 ++ helpers/sql/LICENSE | 201 ++++++++++++++++++ helpers/sql/README.md | 60 ++++++ helpers/sql/Rakefile | 28 +++ helpers/sql/lib/opentelemetry-helpers-sql.rb | 7 + helpers/sql/lib/opentelemetry/helpers.rb | 19 ++ helpers/sql/lib/opentelemetry/helpers/sql.rb | 56 +++++ .../lib/opentelemetry/helpers/sql/version.rb | 13 ++ helpers/sql/opentelemetry-helpers-sql.gemspec | 46 ++++ .../opentelemetry/helpers/sql/sql_test.rb | 100 +++++++++ helpers/sql/test/test_helper.rb | 10 + 17 files changed, 573 insertions(+) create mode 100644 helpers/sql/.rubocop.yml create mode 100644 helpers/sql/.yardopts create mode 100644 helpers/sql/CHANGELOG.md create mode 100644 helpers/sql/Gemfile create mode 100644 helpers/sql/LICENSE create mode 100644 helpers/sql/README.md create mode 100644 helpers/sql/Rakefile create mode 100644 helpers/sql/lib/opentelemetry-helpers-sql.rb create mode 100644 helpers/sql/lib/opentelemetry/helpers.rb create mode 100644 helpers/sql/lib/opentelemetry/helpers/sql.rb create mode 100644 helpers/sql/lib/opentelemetry/helpers/sql/version.rb create mode 100644 helpers/sql/opentelemetry-helpers-sql.gemspec create mode 100644 helpers/sql/test/opentelemetry/helpers/sql/sql_test.rb create mode 100644 helpers/sql/test/test_helper.rb diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5cf3f91db..3bebd5f9c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,6 +9,10 @@ updates: directory: "/" schedule: interval: weekly +- package-ecosystem: bundler + directory: "/helpers/sql" + schedule: + interval: weekly - package-ecosystem: bundler directory: "/helpers/mysql" schedule: diff --git a/.github/workflows/ci-contrib.yml b/.github/workflows/ci-contrib.yml index 39ee9e9e2..d62ff1423 100644 --- a/.github/workflows/ci-contrib.yml +++ b/.github/workflows/ci-contrib.yml @@ -21,6 +21,7 @@ jobs: fail-fast: false matrix: gem: + - sql - mysql - sql-obfuscation os: diff --git a/.toys/.data/releases.yml b/.toys/.data/releases.yml index a90d626e3..ed49e36d2 100644 --- a/.toys/.data/releases.yml +++ b/.toys/.data/releases.yml @@ -30,6 +30,10 @@ commit_lint: # * changelog_path: Path to CHANGLEOG.md relative to the gem directory. # (Required only if it is not in the expected location.) gems: + - name: opentelemetry-helpers-sql + directory: helpers/sql + version_constant: [OpenTelemetry, Helpers, Sql, VERSION] + - name: opentelemetry-instrumentation-gruf directory: instrumentation/gruf version_constant: [OpenTelemetry, Instrumentation, Gruf, VERSION] diff --git a/helpers/sql/.rubocop.yml b/helpers/sql/.rubocop.yml new file mode 100644 index 000000000..1248a2f82 --- /dev/null +++ b/helpers/sql/.rubocop.yml @@ -0,0 +1 @@ +inherit_from: ../../.rubocop.yml diff --git a/helpers/sql/.yardopts b/helpers/sql/.yardopts new file mode 100644 index 000000000..3afbcdd3e --- /dev/null +++ b/helpers/sql/.yardopts @@ -0,0 +1,9 @@ +--no-private +--title=OpenTelemetry Sql Helpers +--markup=markdown +--main=README.md +./lib/opentelemetry/helpers/**/*.rb +./lib/opentelemetry/helpers.rb +- +README.md +CHANGELOG.md diff --git a/helpers/sql/CHANGELOG.md b/helpers/sql/CHANGELOG.md new file mode 100644 index 000000000..f81d19ba5 --- /dev/null +++ b/helpers/sql/CHANGELOG.md @@ -0,0 +1 @@ +# Release History: opentelemetry-helpers-sql diff --git a/helpers/sql/Gemfile b/helpers/sql/Gemfile new file mode 100644 index 000000000..5f1d771fa --- /dev/null +++ b/helpers/sql/Gemfile @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +source 'https://rubygems.org' + +# DO NOT ADD DEPENDENCIES HERE! +# Please declare a minimum development dependency in the gemspec, +# then target specific versions in the Appraisals file. + +gemspec diff --git a/helpers/sql/LICENSE b/helpers/sql/LICENSE new file mode 100644 index 000000000..1ef7dad2c --- /dev/null +++ b/helpers/sql/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/helpers/sql/README.md b/helpers/sql/README.md new file mode 100644 index 000000000..93340cb5e --- /dev/null +++ b/helpers/sql/README.md @@ -0,0 +1,60 @@ +# OpenTelemetry Sql Helpers + +This gem is intended to be used by the instrumentation libraries to provide a common set of helpers for SQL-related spans. It is not intended to be used directly by applications. + +## Installation + +Add a line similar to this in your `gemspec`: + +```ruby + + spec.add_dependency 'opentelemetry-helpers-sql', '~> 0.3' # Use the approprite version + +``` + +Update your `Gemfile` to use the latest version of the gem in the contrib, e.g. + +```ruby + +group :test do + gem 'opentelemetry-helpers-sql', path: '../../helpers/sql' # Use the approprite path +end + +``` + +## Usage + +Some database libraries do not have enough context to add sufficient details to client spans. In these cases, you can use the `OpenTelemetry::Helpers::Sql.with_attributes` to create a set of shared attributes to amend to a database span. + +```ruby +# Higher-level instrumentation e.g. ORM +OpenTelemetry::Helpers::Sql.with_attributes({ 'code.namespace' => 'Acme::Customer', 'code.function' => 'truncate!', 'db.operation.name' => 'TRUNCATE', 'db.namespace' => 'customers' }) do + client.query('TRUNCATE customers') +end + +# Client snippet +class OtherSqlClient + def query(sql) + tracer.in_span("query", attributes: OpenTelemetry::Helpers::Sql.attributes.merge('db.statement' => sql, 'db.system' => 'other_sql')) do + connection.query(sql) + end + end +end +``` + +## How can I get involved? + +The `opentelemetry-helpers-sql` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`. + +The OpenTelemetry Ruby gems are maintained by the OpenTelemetry Ruby special interest group (SIG). You can get involved by joining us on our [GitHub Discussions][discussions-url], [Slack Channel][slack-channel] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig]. + +## License + +The `opentelemetry-helpers-sql` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information. + +[repo-github]: https://github.com/open-telemetry/opentelemetry-ruby +[license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE +[ruby-sig]: https://github.com/open-telemetry/community#ruby-sig +[community-meetings]: https://github.com/open-telemetry/community#community-meetings +[slack-channel]: https://cloud-native.slack.com/archives/C01NWKKMKMY +[discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions diff --git a/helpers/sql/Rakefile b/helpers/sql/Rakefile new file mode 100644 index 000000000..1a64ba842 --- /dev/null +++ b/helpers/sql/Rakefile @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'bundler/gem_tasks' +require 'rake/testtask' +require 'yard' +require 'rubocop/rake_task' + +RuboCop::RakeTask.new + +Rake::TestTask.new :test do |t| + t.libs << 'test' + t.libs << 'lib' + t.test_files = FileList['test/**/*_test.rb'] +end + +YARD::Rake::YardocTask.new do |t| + t.stats_options = ['--list-undoc'] +end + +if RUBY_ENGINE == 'truffleruby' + task default: %i[test] +else + task default: %i[test rubocop yard] +end diff --git a/helpers/sql/lib/opentelemetry-helpers-sql.rb b/helpers/sql/lib/opentelemetry-helpers-sql.rb new file mode 100644 index 000000000..a839b7e58 --- /dev/null +++ b/helpers/sql/lib/opentelemetry-helpers-sql.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require_relative 'opentelemetry/helpers' diff --git a/helpers/sql/lib/opentelemetry/helpers.rb b/helpers/sql/lib/opentelemetry/helpers.rb new file mode 100644 index 000000000..290f78bf6 --- /dev/null +++ b/helpers/sql/lib/opentelemetry/helpers.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +# OpenTelemetry is an open source observability framework, providing a +# general-purpose API, SDK, and related tools required for the instrumentation +# of cloud-native software, frameworks, and libraries. +# +# The OpenTelemetry module provides global accessors for telemetry objects. +# See the documentation for the `opentelemetry-api` gem for details. +module OpenTelemetry + # Helpers should be able to handle the case when the library is not installed on a user's system. + module Helpers + end +end + +require_relative 'helpers/sql' diff --git a/helpers/sql/lib/opentelemetry/helpers/sql.rb b/helpers/sql/lib/opentelemetry/helpers/sql.rb new file mode 100644 index 000000000..5c4f0cc98 --- /dev/null +++ b/helpers/sql/lib/opentelemetry/helpers/sql.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'opentelemetry' + +module OpenTelemetry + module Helpers + # Contains helpers for OpenTelemetry instrumentation related to SQL + module Sql + extend self + + CURRENT_ATTRIBUTES_KEY = Context.create_key('sql-attributes-hash') + + private_constant :CURRENT_ATTRIBUTES_KEY + + # Returns the attributes hash representing the SQL adapter context found + # in the optional context or the current context if none is provided. + # + # @param [optional Context] context The context to lookup the current + # attributes hash. Defaults to Context.current + def attributes(context = nil) + context ||= Context.current + context.value(CURRENT_ATTRIBUTES_KEY) || {} + end + + # Returns a context containing the merged attributes hash, derived from the + # optional parent context, or the current context if one was not provided. + # + # @param [optional Context] context The context to use as the parent for + # the returned context + def context_with_attributes(attributes_hash, parent_context: Context.current) + attributes_hash = attributes(parent_context).merge(attributes_hash) + parent_context.set_value(CURRENT_ATTRIBUTES_KEY, attributes_hash) + end + + # Activates/deactivates the merged attributes hash within the current Context, + # which makes the "current attributes hash" available implicitly. + # + # On exit, the attributes hash that was active before calling this method + # will be reactivated. + # + # @param [Span] span the span to activate + # @yield [Hash, Context] yields attributes hash and a context containing the + # attributes hash to the block. + def with_attributes(attributes_hash) + attributes_hash = attributes.merge(attributes_hash) + Context.with_value(CURRENT_ATTRIBUTES_KEY, attributes_hash) { |c, h| yield h, c } + end + end + end +end + +require_relative 'sql/version' diff --git a/helpers/sql/lib/opentelemetry/helpers/sql/version.rb b/helpers/sql/lib/opentelemetry/helpers/sql/version.rb new file mode 100644 index 000000000..b6dd75249 --- /dev/null +++ b/helpers/sql/lib/opentelemetry/helpers/sql/version.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +module OpenTelemetry + module Helpers + module Sql + VERSION = '0.0.0' + end + end +end diff --git a/helpers/sql/opentelemetry-helpers-sql.gemspec b/helpers/sql/opentelemetry-helpers-sql.gemspec new file mode 100644 index 000000000..d006d9211 --- /dev/null +++ b/helpers/sql/opentelemetry-helpers-sql.gemspec @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +lib = File.expand_path('lib', __dir__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'opentelemetry/helpers/sql/version' + +Gem::Specification.new do |spec| + spec.name = 'opentelemetry-helpers-sql' + spec.version = OpenTelemetry::Helpers::Sql::VERSION + spec.authors = ['OpenTelemetry Authors'] + spec.email = ['cncf-opentelemetry-contributors@lists.cncf.io'] + + spec.summary = 'SQL helpers for the OpenTelemetry framework' + spec.description = 'SQL helpers for the OpenTelemetry framework' + spec.homepage = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib' + spec.license = 'Apache-2.0' + + spec.files = Dir.glob('lib/**/*.rb') + + Dir.glob('*.md') + + ['LICENSE', '.yardopts'] + spec.require_paths = ['lib'] + spec.required_ruby_version = '>= 3.1' + + spec.add_dependency 'opentelemetry-api', '~> 1.4.0' + + spec.add_development_dependency 'appraisal', '~> 2.5' + spec.add_development_dependency 'bundler', '~> 2.4' + spec.add_development_dependency 'minitest', '~> 5.0' + spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' + spec.add_development_dependency 'rake', '~> 13.0' + spec.add_development_dependency 'rubocop', '~> 1.71.0' + spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' + spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'yard', '~> 0.9' + + if spec.respond_to?(:metadata) + spec.metadata['changelog_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}/file/CHANGELOG.md" + spec.metadata['source_code_uri'] = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/helpers/sql' + spec.metadata['bug_tracker_uri'] = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues' + spec.metadata['documentation_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}" + end +end diff --git a/helpers/sql/test/opentelemetry/helpers/sql/sql_test.rb b/helpers/sql/test/opentelemetry/helpers/sql/sql_test.rb new file mode 100644 index 000000000..bf9927950 --- /dev/null +++ b/helpers/sql/test/opentelemetry/helpers/sql/sql_test.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'test_helper' + +require_relative '../../../../lib/opentelemetry/helpers/sql' + +describe OpenTelemetry::Helpers::Sql do + describe 'when using implicit contexts' do + it 'manages shared attributes with child contexts' do + actual_attrs = nil + actual_context = nil + + shared_attrs = { 'db.operation' => 'foo' } + + OpenTelemetry::Helpers::Sql.with_attributes(shared_attrs.dup) do |_, child| + actual_attrs = OpenTelemetry::Helpers::Sql.attributes + actual_context = child + end + + _(OpenTelemetry::Helpers::Sql.attributes(actual_context)).must_equal(shared_attrs) + _(actual_attrs).must_equal(shared_attrs) + end + + it 'provides immediate access to shared attributes' do + actual_attrs = nil + shared_attrs = { 'db.operation' => 'foo' } + + OpenTelemetry::Helpers::Sql.with_attributes(shared_attrs.dup) do |attrs, _| + actual_attrs = attrs + end + + _(actual_attrs).must_equal(shared_attrs) + end + + it 'manages shared attributes using an implicit context' do + shared_attrs = { 'db.operation' => 'foo' } + actual_attrs = nil + actual_context = OpenTelemetry::Helpers::Sql.context_with_attributes(shared_attrs.dup) + OpenTelemetry::Context.with_current(actual_context) do + actual_attrs = OpenTelemetry::Helpers::Sql.attributes + end + + _(actual_context).wont_equal(OpenTelemetry::Context.current) + _(actual_attrs).must_equal(shared_attrs) + end + end + + describe 'when using explicit contexts' do + it 'manages shared attributes using a child child contexts' do + actual_attrs = nil + actual_context = nil + + shared_attrs = { 'db.operation' => 'foo' } + + root_context = OpenTelemetry::Context.empty + + OpenTelemetry::Helpers::Sql.with_attributes(shared_attrs.dup) do |_, child| + actual_attrs = OpenTelemetry::Helpers::Sql.attributes(child) + actual_context = child + end + + _(actual_context).wont_equal(root_context) + _(actual_attrs).must_equal(shared_attrs) + end + + it 'manages shared attributes using a provided context' do + shared_attrs = { 'db.operation' => 'foo' } + + root_context = OpenTelemetry::Context.empty + actual_context = OpenTelemetry::Helpers::Sql.context_with_attributes(shared_attrs.dup, parent_context: root_context) + actual_attrs = OpenTelemetry::Helpers::Sql.attributes(actual_context) + + _(actual_context).wont_equal(root_context) + _(actual_attrs).must_equal(shared_attrs) + end + + describe 'given the incorrect context' do + it 'attempts to find shared attributes' do + actual_attrs = nil + actual_context = nil + + shared_attrs = { 'db.operation' => 'foo' } + + root_context = OpenTelemetry::Context.empty + + OpenTelemetry::Helpers::Sql.with_attributes(shared_attrs.dup) do |_, child| + actual_attrs = OpenTelemetry::Helpers::Sql.attributes(root_context) + actual_context = child + end + + _(actual_context).wont_equal(root_context) + _(actual_attrs).must_be_empty + end + end + end +end diff --git a/helpers/sql/test/test_helper.rb b/helpers/sql/test/test_helper.rb new file mode 100644 index 000000000..026a026a2 --- /dev/null +++ b/helpers/sql/test/test_helper.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'bundler/setup' +Bundler.require(:default, :development, :test) + +require 'minitest/autorun' From ce01f6d3cd1642e3af3224f76ea8cc627dabdbdc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:34:21 -0600 Subject: [PATCH 03/20] release: Release opentelemetry-helpers-sql 0.1.0 (initial release) (#1368) * release: Release opentelemetry-helpers-sql 0.1.0 (initial release) * ci: Force --------- Co-authored-by: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Co-authored-by: Ariel Valentin --- helpers/sql/CHANGELOG.md | 4 ++++ helpers/sql/lib/opentelemetry/helpers/sql/version.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/helpers/sql/CHANGELOG.md b/helpers/sql/CHANGELOG.md index f81d19ba5..38d60f1c7 100644 --- a/helpers/sql/CHANGELOG.md +++ b/helpers/sql/CHANGELOG.md @@ -1 +1,5 @@ # Release History: opentelemetry-helpers-sql + +### v0.1.0 / 2025-01-24 + +Initial release. diff --git a/helpers/sql/lib/opentelemetry/helpers/sql/version.rb b/helpers/sql/lib/opentelemetry/helpers/sql/version.rb index b6dd75249..7d479471c 100644 --- a/helpers/sql/lib/opentelemetry/helpers/sql/version.rb +++ b/helpers/sql/lib/opentelemetry/helpers/sql/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Helpers module Sql - VERSION = '0.0.0' + VERSION = '0.1.0' end end end From a08467abe1ba51c32bdcb1162008b7cf1eaf598b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Doyle Date: Mon, 27 Jan 2025 14:18:29 -0500 Subject: [PATCH 04/20] docs: required version in Rails README from 0.24 to 0.34 (#1369) fix: Change required version in Rails README from 0.24 to 0.34 --- instrumentation/rails/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/rails/README.md b/instrumentation/rails/README.md index d1de1da14..efb048ca8 100644 --- a/instrumentation/rails/README.md +++ b/instrumentation/rails/README.md @@ -24,8 +24,8 @@ gem opentelemetry-instrumentation-rails, "" | --- | --- | | `5.2` | `= 0.24.1` | | `6.0` | `= 0.28.0` | -| `6.1` | `= 0.24` | -| `7.x` | `~> 0.24` | +| `6.1` | `= 0.34` | +| `7.x` | `~> 0.34` | ## Usage From 21acdabf1612390956cb47ad76cb8345a503cb37 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Mon, 27 Jan 2025 20:08:39 -0600 Subject: [PATCH 05/20] refactor: Use SQL helpers (#1271) --- instrumentation/mysql2/Gemfile | 1 + .../opentelemetry/instrumentation/mysql2.rb | 41 +------------------ ...entelemetry-instrumentation-mysql2.gemspec | 1 + instrumentation/pg/Gemfile | 1 + .../lib/opentelemetry/instrumentation/pg.rb | 31 +------------- .../opentelemetry-instrumentation-pg.gemspec | 1 + instrumentation/que/Gemfile | 1 + instrumentation/trilogy/Gemfile | 1 + .../opentelemetry/instrumentation/trilogy.rb | 41 +------------------ ...ntelemetry-instrumentation-trilogy.gemspec | 2 +- 10 files changed, 13 insertions(+), 108 deletions(-) diff --git a/instrumentation/mysql2/Gemfile b/instrumentation/mysql2/Gemfile index 6ba31761a..fc50ea311 100644 --- a/instrumentation/mysql2/Gemfile +++ b/instrumentation/mysql2/Gemfile @@ -10,6 +10,7 @@ gemspec group :test, :development do gem 'opentelemetry-instrumentation-base', path: '../base' + gem 'opentelemetry-helpers-sql', path: '../../helpers/sql' gem 'opentelemetry-helpers-mysql', path: '../../helpers/mysql' gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation' end diff --git a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2.rb b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2.rb index 186523915..a10bcc1d6 100644 --- a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2.rb +++ b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2.rb @@ -6,50 +6,13 @@ require 'opentelemetry' require 'opentelemetry-instrumentation-base' +require 'opentelemetry-helpers-sql' module OpenTelemetry module Instrumentation # Contains the OpenTelemetry instrumentation for the Mysql2 gem module Mysql2 - extend self - - CURRENT_ATTRIBUTES_KEY = Context.create_key('mysql-attributes-hash') - - private_constant :CURRENT_ATTRIBUTES_KEY - - # Returns the attributes hash representing the Mysql2 context found - # in the optional context or the current context if none is provided. - # - # @param context [optional Context] The context to lookup the current - # attributes hash. Defaults to Context.current - def attributes(context = nil) - context ||= Context.current - context.value(CURRENT_ATTRIBUTES_KEY) || {} - end - - # @param attributes_hash [Hash] The attributes to add to the context - # @param parent_context [optional Context] The context to use as the parent for - # the returned context - # @return A context containing the merged attributes hash, derived from the - # optional parent context, or the current context if one was not provided. - def context_with_attributes(attributes_hash, parent_context: Context.current) - attributes_hash = attributes(parent_context).merge(attributes_hash) - parent_context.set_value(CURRENT_ATTRIBUTES_KEY, attributes_hash) - end - - # Activates/deactivates the merged attributes hash within the current Context, - # which makes the "current attributes hash" available implicitly. - # - # On exit, the attributes hash that was active before calling this method - # will be reactivated. - # - # @param [Span] span the span to activate - # @yield [Hash, Context] yields attributes hash and a context containing the - # attributes hash to the block. - def with_attributes(attributes_hash) - attributes_hash = attributes.merge(attributes_hash) - Context.with_value(CURRENT_ATTRIBUTES_KEY, attributes_hash) { |c, h| yield h, c } - end + extend ::OpenTelemetry::Helpers::Sql end end end diff --git a/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec b/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec index 97584c0a3..6789d4e2a 100644 --- a/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec +++ b/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec @@ -27,6 +27,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-api', '~> 1.0' spec.add_dependency 'opentelemetry-helpers-mysql' + spec.add_dependency 'opentelemetry-helpers-sql' spec.add_dependency 'opentelemetry-helpers-sql-obfuscation' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.23.0' diff --git a/instrumentation/pg/Gemfile b/instrumentation/pg/Gemfile index 8f0cfc4f6..a298585bb 100644 --- a/instrumentation/pg/Gemfile +++ b/instrumentation/pg/Gemfile @@ -11,5 +11,6 @@ gemspec group :test do gem 'activerecord', '>= 7.0.0' gem 'opentelemetry-instrumentation-base', path: '../base' + gem 'opentelemetry-helpers-sql', path: '../../helpers/sql' gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation' end diff --git a/instrumentation/pg/lib/opentelemetry/instrumentation/pg.rb b/instrumentation/pg/lib/opentelemetry/instrumentation/pg.rb index 43b9263c0..72b2d3e37 100644 --- a/instrumentation/pg/lib/opentelemetry/instrumentation/pg.rb +++ b/instrumentation/pg/lib/opentelemetry/instrumentation/pg.rb @@ -6,40 +6,13 @@ require 'opentelemetry' require 'opentelemetry-instrumentation-base' +require 'opentelemetry-helpers-sql' module OpenTelemetry module Instrumentation # Contains the OpenTelemetry instrumentation for the Pg gem module PG - extend self - - CURRENT_ATTRIBUTES_KEY = Context.create_key('pg-attributes-hash') - - private_constant :CURRENT_ATTRIBUTES_KEY - - # Returns the attributes hash representing the postgres client context found - # in the optional context or the current context if none is provided. - # - # @param [optional Context] context The context to lookup the current - # attributes hash. Defaults to Context.current - def attributes(context = nil) - context ||= Context.current - context.value(CURRENT_ATTRIBUTES_KEY) || {} - end - - # Activates/deactivates the merged attributes hash within the current Context, - # which makes the "current attributes hash" available implicitly. - # - # On exit, the attributes hash that was active before calling this method - # will be reactivated. - # - # @param [Span] span the span to activate - # @yield [Hash, Context] yields attributes hash and a context containing the - # attributes hash to the block. - def with_attributes(attributes_hash) - attributes_hash = attributes.merge(attributes_hash) - Context.with_value(CURRENT_ATTRIBUTES_KEY, attributes_hash) { |c, h| yield h, c } - end + extend ::OpenTelemetry::Helpers::Sql end end end diff --git a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec index 8d01fe319..c36e2b867 100644 --- a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec +++ b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec @@ -26,6 +26,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.1' spec.add_dependency 'opentelemetry-api', '~> 1.0' + spec.add_dependency 'opentelemetry-helpers-sql' spec.add_dependency 'opentelemetry-helpers-sql-obfuscation' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.23.0' diff --git a/instrumentation/que/Gemfile b/instrumentation/que/Gemfile index 1c201b285..9a673d3a2 100644 --- a/instrumentation/que/Gemfile +++ b/instrumentation/que/Gemfile @@ -11,6 +11,7 @@ gemspec group :test do gem 'activerecord', '< 7.2.0', '> 7.0.0' gem 'pg' + gem 'opentelemetry-helpers-sql', path: '../../helpers/sql' gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation' gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-instrumentation-pg', path: '../pg' diff --git a/instrumentation/trilogy/Gemfile b/instrumentation/trilogy/Gemfile index de6a67cae..2484ca993 100644 --- a/instrumentation/trilogy/Gemfile +++ b/instrumentation/trilogy/Gemfile @@ -11,6 +11,7 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-helpers-mysql', path: '../../helpers/mysql' + gem 'opentelemetry-helpers-sql', path: '../../helpers/sql' gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation' gem 'opentelemetry-propagator-vitess', path: '../../propagator/vitess' end diff --git a/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy.rb b/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy.rb index 00a6e1a28..375543471 100644 --- a/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy.rb +++ b/instrumentation/trilogy/lib/opentelemetry/instrumentation/trilogy.rb @@ -6,50 +6,13 @@ require 'opentelemetry' require 'opentelemetry-instrumentation-base' +require 'opentelemetry-helpers-sql' module OpenTelemetry module Instrumentation # Contains the OpenTelemetry instrumentation for the Trilogy gem module Trilogy - extend self - - CURRENT_ATTRIBUTES_KEY = Context.create_key('trilogy-attributes-hash') - - private_constant :CURRENT_ATTRIBUTES_KEY - - # Returns the attributes hash representing the Trilogy context found - # in the optional context or the current context if none is provided. - # - # @param [optional Context] context The context to lookup the current - # attributes hash. Defaults to Context.current - def attributes(context = nil) - context ||= Context.current - context.value(CURRENT_ATTRIBUTES_KEY) || {} - end - - # Returns a context containing the merged attributes hash, derived from the - # optional parent context, or the current context if one was not provided. - # - # @param [optional Context] context The context to use as the parent for - # the returned context - def context_with_attributes(attributes_hash, parent_context: Context.current) - attributes_hash = attributes(parent_context).merge(attributes_hash) - parent_context.set_value(CURRENT_ATTRIBUTES_KEY, attributes_hash) - end - - # Activates/deactivates the merged attributes hash within the current Context, - # which makes the "current attributes hash" available implicitly. - # - # On exit, the attributes hash that was active before calling this method - # will be reactivated. - # - # @param [Span] span the span to activate - # @yield [Hash, Context] yields attributes hash and a context containing the - # attributes hash to the block. - def with_attributes(attributes_hash) - attributes_hash = attributes.merge(attributes_hash) - Context.with_value(CURRENT_ATTRIBUTES_KEY, attributes_hash) { |c, h| yield h, c } - end + extend ::OpenTelemetry::Helpers::Sql end end end diff --git a/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec b/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec index 98999a9d8..2899a12f4 100644 --- a/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec +++ b/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec @@ -27,6 +27,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-api', '~> 1.0' spec.add_dependency 'opentelemetry-helpers-mysql' + spec.add_dependency 'opentelemetry-helpers-sql' spec.add_dependency 'opentelemetry-helpers-sql-obfuscation' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.23.0' spec.add_dependency 'opentelemetry-semantic_conventions', '>= 1.8.0' @@ -34,7 +35,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'appraisal', '~> 2.5' spec.add_development_dependency 'bundler', '~> 2.4' spec.add_development_dependency 'minitest', '~> 5.0' - spec.add_development_dependency 'opentelemetry-propagator-vitess', '~> 0.1' spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'pry' From 14a6d963d14c71d54b9aafbabf60fa28f44f742c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 14:48:19 -0600 Subject: [PATCH 06/20] release: Release opentelemetry-instrumentation-rails 0.35.1 (was 0.35.0) (#1372) * release: Release opentelemetry-instrumentation-rails 0.35.1 (was 0.35.0) * docs: Update CHANGELOG.md --------- Co-authored-by: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Co-authored-by: Ariel Valentin --- instrumentation/rails/CHANGELOG.md | 4 ++++ .../rails/lib/opentelemetry/instrumentation/rails/version.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/instrumentation/rails/CHANGELOG.md b/instrumentation/rails/CHANGELOG.md index f34e01bd8..92044321e 100644 --- a/instrumentation/rails/CHANGELOG.md +++ b/instrumentation/rails/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-rails +### v0.35.1 / 2025-01-28 + +* DOCS: Required version in Rails README from 0.24 to 0.34. + ### v0.35.0 / 2025-01-16 * BREAKING CHANGE: Drop Support for EoL Rails 6.1 diff --git a/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb b/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb index b8c5969c0..c876b9ead 100644 --- a/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb +++ b/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Rails - VERSION = '0.35.0' + VERSION = '0.35.1' end end end From 0b0a18b096a35e21cbb169fc2014dd87ffbec212 Mon Sep 17 00:00:00 2001 From: "Y.Matsuda" <44557218+ymtdzzz@users.noreply.github.com> Date: Wed, 29 Jan 2025 06:10:25 +0900 Subject: [PATCH 07/20] feat: Add ActiveStorage instrumentation (#1313) * feat: Add ActiveStorage instrumentation * fix: markdown lint error in README.md * fix: rubocop error in opentelemetry-instrumentation-all.gemspec * feat: remove support for Rails 6.1 * docs: add default value on `:disallowed_notification_payload_keys` * feat: match rubocop and opentelemetry-instrumentation-base version with other packages * test: add explicit require to `logger` * test: remove unnecessary conditions * chore: add imagemagick package to Dockerfile * feat: change active_storage instrumentation version to 0.1.0 and remove active_storage from all * chore: update instrumentation/active_storage CODEOWNERS --------- Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> --- .github/actions/test_gem/action.yml | 8 + .github/workflows/ci-instrumentation.yml | 2 + .toys/.data/releases.yml | 4 + CODEOWNERS | 2 + Dockerfile | 1 + instrumentation/active_storage/.rubocop.yml | 1 + instrumentation/active_storage/.yardopts | 9 + instrumentation/active_storage/Appraisals | 29 ++ instrumentation/active_storage/CHANGELOG.md | 1 + instrumentation/active_storage/Gemfile | 14 + instrumentation/active_storage/LICENSE | 201 ++++++++++ instrumentation/active_storage/README.md | 97 +++++ instrumentation/active_storage/Rakefile | 28 ++ .../example/trace_demonstration.rb | 97 +++++ ...elemetry-instrumentation-active_storage.rb | 7 + .../lib/opentelemetry/instrumentation.rb | 19 + .../instrumentation/active_storage.rb | 19 + .../active_storage/instrumentation.rb | 130 +++++++ .../instrumentation/active_storage/railtie.rb | 57 +++ .../instrumentation/active_storage/version.rb | 13 + ...try-instrumentation-active_storage.gemspec | 50 +++ .../active_storage/test/fixtures/sample.pdf | Bin 0 -> 18810 bytes .../active_storage/test/fixtures/sample.png | Bin 0 -> 271 bytes .../active_storage/instrumentation_test.rb | 108 ++++++ .../active_storage/subscription_test.rb | 360 ++++++++++++++++++ .../active_storage/test/test_helper.rb | 26 ++ .../test/test_helpers/app_config.rb | 98 +++++ .../test/test_helpers/test_previewer.rb | 28 ++ 28 files changed, 1409 insertions(+) create mode 100644 instrumentation/active_storage/.rubocop.yml create mode 100644 instrumentation/active_storage/.yardopts create mode 100644 instrumentation/active_storage/Appraisals create mode 100644 instrumentation/active_storage/CHANGELOG.md create mode 100644 instrumentation/active_storage/Gemfile create mode 100644 instrumentation/active_storage/LICENSE create mode 100644 instrumentation/active_storage/README.md create mode 100644 instrumentation/active_storage/Rakefile create mode 100644 instrumentation/active_storage/example/trace_demonstration.rb create mode 100644 instrumentation/active_storage/lib/opentelemetry-instrumentation-active_storage.rb create mode 100644 instrumentation/active_storage/lib/opentelemetry/instrumentation.rb create mode 100644 instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage.rb create mode 100644 instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/instrumentation.rb create mode 100644 instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/railtie.rb create mode 100644 instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/version.rb create mode 100644 instrumentation/active_storage/opentelemetry-instrumentation-active_storage.gemspec create mode 100644 instrumentation/active_storage/test/fixtures/sample.pdf create mode 100644 instrumentation/active_storage/test/fixtures/sample.png create mode 100644 instrumentation/active_storage/test/opentelemetry/instrumentation/active_storage/instrumentation_test.rb create mode 100644 instrumentation/active_storage/test/opentelemetry/instrumentation/active_storage/subscription_test.rb create mode 100644 instrumentation/active_storage/test/test_helper.rb create mode 100644 instrumentation/active_storage/test/test_helpers/app_config.rb create mode 100644 instrumentation/active_storage/test/test_helpers/test_previewer.rb diff --git a/.github/actions/test_gem/action.yml b/.github/actions/test_gem/action.yml index c7ab16b45..05dbf4e02 100644 --- a/.github/actions/test_gem/action.yml +++ b/.github/actions/test_gem/action.yml @@ -62,6 +62,14 @@ runs: fi fi + # Install ImageMagick for active_storage testing. + # Unfortunately, as of ubuntu-24.04, ImageMagick is no longer pre-installed in Github Actions. + # See https://github.com/actions/runner-images/issues/10772 + - name: Install ImageMagick for active_storage testing + if: "${{ inputs.gem == 'opentelemetry-instrumentation-active_storage' }}" + shell: bash + run: sudo apt update && sudo apt install -y imagemagick + # Install ruby and bundle dependencies and cache! # ...but not for appraisals, sadly. - name: Install Ruby ${{ inputs.ruby }} with dependencies diff --git a/.github/workflows/ci-instrumentation.yml b/.github/workflows/ci-instrumentation.yml index c0a123901..31ffe8c65 100644 --- a/.github/workflows/ci-instrumentation.yml +++ b/.github/workflows/ci-instrumentation.yml @@ -27,6 +27,7 @@ jobs: - active_job - active_model_serializers - active_record + - active_storage - active_support - all - aws_sdk @@ -86,6 +87,7 @@ jobs: [[ "${{ matrix.gem }}" == "action_view" ]] && echo "skip=true" >> $GITHUB_OUTPUT [[ "${{ matrix.gem }}" == "active_model_serializers" ]] && echo "skip=true" >> $GITHUB_OUTPUT [[ "${{ matrix.gem }}" == "active_record" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "active_storage" ]] && echo "skip=true" >> $GITHUB_OUTPUT [[ "${{ matrix.gem }}" == "active_support" ]] && echo "skip=true" >> $GITHUB_OUTPUT [[ "${{ matrix.gem }}" == "aws_sdk" ]] && echo "skip=true" >> $GITHUB_OUTPUT [[ "${{ matrix.gem }}" == "aws_lambda" ]] && echo "skip=true" >> $GITHUB_OUTPUT diff --git a/.toys/.data/releases.yml b/.toys/.data/releases.yml index ed49e36d2..a7068cabf 100644 --- a/.toys/.data/releases.yml +++ b/.toys/.data/releases.yml @@ -30,6 +30,10 @@ commit_lint: # * changelog_path: Path to CHANGLEOG.md relative to the gem directory. # (Required only if it is not in the expected location.) gems: + - name: opentelemetry-instrumentation-active_storage + directory: instrumentation/active_storage + version_constant: [OpenTelemetry, Instrumentation, ActiveStorage, VERSION] + - name: opentelemetry-helpers-sql directory: helpers/sql version_constant: [OpenTelemetry, Helpers, Sql, VERSION] diff --git a/CODEOWNERS b/CODEOWNERS index 96e9c51be..ffc248e28 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -16,6 +16,8 @@ resources/container/ @scbjans @open-telemetry/ruby-contrib-maintainers @open-telemetry/ruby-contrib-approvers @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @simi @kaylareopelle @xuan-cao-swi +instrumentation/active_storage/ @ymtdzzz @open-telemetry/ruby-contrib-maintainers @open-telemetry/ruby-contrib-approvers @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @simi @kaylareopelle @xuan-cao-swi + instrumentation/aws_sdk/ @jterapin @alextwoods @NathanielRN @open-telemetry/ruby-contrib-maintainers @open-telemetry/ruby-contrib-approvers @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @simi @kaylareopelle @xuan-cao-swi instrumentation/grape/ @muripic @open-telemetry/ruby-contrib-maintainers @open-telemetry/ruby-contrib-approvers @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @simi @kaylareopelle @xuan-cao-swi diff --git a/Dockerfile b/Dockerfile index a52d46c22..80a23e16d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,6 +38,7 @@ ARG PACKAGES="\ postgresql-dev \ tzdata \ util-linux \ + imagemagick \ " # Install packages RUN apk update && \ diff --git a/instrumentation/active_storage/.rubocop.yml b/instrumentation/active_storage/.rubocop.yml new file mode 100644 index 000000000..1248a2f82 --- /dev/null +++ b/instrumentation/active_storage/.rubocop.yml @@ -0,0 +1 @@ +inherit_from: ../../.rubocop.yml diff --git a/instrumentation/active_storage/.yardopts b/instrumentation/active_storage/.yardopts new file mode 100644 index 000000000..1875c0c85 --- /dev/null +++ b/instrumentation/active_storage/.yardopts @@ -0,0 +1,9 @@ +--no-private +--title=OpenTelemetry Active Storage Instrumentation +--markup=markdown +--main=README.md +./lib/opentelemetry/instrumentation/**/*.rb +./lib/opentelemetry/instrumentation.rb +- +README.md +CHANGELOG.md diff --git a/instrumentation/active_storage/Appraisals b/instrumentation/active_storage/Appraisals new file mode 100644 index 000000000..4e2bd92d9 --- /dev/null +++ b/instrumentation/active_storage/Appraisals @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +%w[7.0.0 7.1.0].each do |version| + appraise "activestorage-#{version}" do + gem 'sqlite3', '~> 1.4' + gem 'image_processing', '~> 1.2' + gem 'rails', "~> #{version}" + end +end + +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0') + %w[7.2.0].each do |version| + appraise "activestorage-#{version}" do + gem 'sqlite3', '~> 1.4' + gem 'image_processing', '~> 1.2' + gem 'rails', "~> #{version}" + end + end + + appraise 'activestorage-latest' do + gem 'sqlite3', '>= 2.1' + gem 'image_processing', '~> 1.2' + gem 'rails' + end +end diff --git a/instrumentation/active_storage/CHANGELOG.md b/instrumentation/active_storage/CHANGELOG.md new file mode 100644 index 000000000..6e60ce45e --- /dev/null +++ b/instrumentation/active_storage/CHANGELOG.md @@ -0,0 +1 @@ +# Release History: opentelemetry-instrumentation-active_storage diff --git a/instrumentation/active_storage/Gemfile b/instrumentation/active_storage/Gemfile new file mode 100644 index 000000000..2ededff74 --- /dev/null +++ b/instrumentation/active_storage/Gemfile @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +source 'https://rubygems.org' + +gemspec + +group :test do + gem 'opentelemetry-instrumentation-base', path: '../base' + gem 'opentelemetry-instrumentation-active_support', path: '../active_support' +end diff --git a/instrumentation/active_storage/LICENSE b/instrumentation/active_storage/LICENSE new file mode 100644 index 000000000..1ef7dad2c --- /dev/null +++ b/instrumentation/active_storage/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright The OpenTelemetry Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/instrumentation/active_storage/README.md b/instrumentation/active_storage/README.md new file mode 100644 index 000000000..3ee418aaf --- /dev/null +++ b/instrumentation/active_storage/README.md @@ -0,0 +1,97 @@ +# OpenTelemetry ActiveStorage Instrumentation + +The ActiveStorage instrumentation is a community-maintained instrumentation for the ActiveStorage portion of the [Ruby on Rails][rails-home] web-application framework. + +## How do I get started? + +Install the gem using: + +```bash +# Install just the ActiveStorage instrumentation +gem install opentelemetry-instrumentation-active_storage +# Install the ActiveStorage instrumentation along with the rest of the Rails-related instrumentation +gem install opentelemetry-instrumentation-rails +``` + +Or, if you use [bundler][bundler-home], include `opentelemetry-instrumentation-active_storage` in your `Gemfile`. + +## Usage + +To use the instrumentation, call `use` with the name of the instrumentation: + +```ruby +OpenTelemetry::SDK.configure do |c| + # Use only the ActiveStorage instrumentation + c.use 'OpenTelemetry::Instrumentation::ActiveStorage' + # Use the ActiveStorage instrumentation along with the rest of the Rails-related instrumentation + c.use 'OpenTelemetry::Instrumentation::Rails' +end +``` + +Alternatively, you can also call `use_all` to install all the available instrumentation. + +```ruby +OpenTelemetry::SDK.configure do |c| + c.use_all +end +``` + +## Active Support Instrumentation + +This instrumentation relies entirely on `ActiveSupport::Notifications` and registers a custom Subscriber that listens to relevant events to report as spans. + +See the table below for details of what [Rails Framework Hook Events](https://guides.rubyonrails.org/active_support_instrumentation.html#active-storage) are recorded by this instrumentation: + +| Event Name | Creates Span? | Notes | +| - | - | - | +| `preview.active_storage` | :white_check_mark: | Creates an `internal` span | +| `transform.active_storage` | :white_check_mark: | Creates an `internal` span | +| `analyze.active_storage` | :white_check_mark: | Creates an `internal` span | +| `service_upload.active_storage` | :white_check_mark: | Creates an `internal` span | +| `service_streaming_download.active_storage` | :white_check_mark: | Creates an `internal` span | +| `service_download_chunk.active_storage` | :white_check_mark: | Creates an `internal` span | +| `service_download.active_storage` | :white_check_mark: | Creates an `internal` span | +| `service_delete.active_storage` | :white_check_mark: | Creates an `internal` span | +| `service_delete_prefixed.active_storage` | :white_check_mark: | Creates an `internal` span | +| `service_exist.active_storage` | :white_check_mark: | Creates an `internal` span | +| `service_url.active_storage` | :white_check_mark: | Creates an `internal` span | +| `service_update_metadata.active_storage` | :white_check_mark: | Creates an `internal` span | + +### Options + +ActiveStorage instrumentation doesn't expose secure tokens and urls by default, but if they are needed, simply use `:key` and `:url` option: + +```ruby +OpenTelemetry::SDK.configure do |c| + c.use 'OpenTelemetry::Instrumentation::ActiveStorage', { key: :include, url: :include } +end +``` + +## Semantic Conventions + +Internal spans are named using the name of the `ActiveSupport` event that was provided (e.g. `service_upload.active_storage`). + +Attributes attached to each event payload are prefixed with `active_storage.` (e.g. `active_storage.checksum`). + +## Examples + +Example usage can be seen in the `./example/trace_demonstration.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/instrumentation/active_storage/example/trace_demonstration.rb) + +## How can I get involved? + +The `opentelemetry-instrumentation-active_storage` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`. + +The OpenTelemetry Ruby gems are maintained by the OpenTelemetry Ruby special interest group (SIG). You can get involved by joining us on our [GitHub Discussions][discussions-url], [Slack Channel][slack-channel] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig]. + +## License + +The `opentelemetry-instrumentation-active_storage` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information. + +[rails-home]: https://github.com/rails/rails +[bundler-home]: https://bundler.io +[repo-github]: https://github.com/open-telemetry/opentelemetry-ruby +[license-github]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/LICENSE +[ruby-sig]: https://github.com/open-telemetry/community#ruby-sig +[community-meetings]: https://github.com/open-telemetry/community#community-meetings +[slack-channel]: https://cloud-native.slack.com/archives/C01NWKKMKMY +[discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions diff --git a/instrumentation/active_storage/Rakefile b/instrumentation/active_storage/Rakefile new file mode 100644 index 000000000..1a64ba842 --- /dev/null +++ b/instrumentation/active_storage/Rakefile @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'bundler/gem_tasks' +require 'rake/testtask' +require 'yard' +require 'rubocop/rake_task' + +RuboCop::RakeTask.new + +Rake::TestTask.new :test do |t| + t.libs << 'test' + t.libs << 'lib' + t.test_files = FileList['test/**/*_test.rb'] +end + +YARD::Rake::YardocTask.new do |t| + t.stats_options = ['--list-undoc'] +end + +if RUBY_ENGINE == 'truffleruby' + task default: %i[test] +else + task default: %i[test rubocop yard] +end diff --git a/instrumentation/active_storage/example/trace_demonstration.rb b/instrumentation/active_storage/example/trace_demonstration.rb new file mode 100644 index 000000000..db09b4026 --- /dev/null +++ b/instrumentation/active_storage/example/trace_demonstration.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'bundler/inline' + +gemfile(true) do + source 'https://rubygems.org' + + gem 'rails' + gem 'sqlite3' + gem 'opentelemetry-sdk' + gem 'opentelemetry-instrumentation-active_support', path: '../../active_support' + gem 'opentelemetry-instrumentation-active_storage', path: '../' +end + +require 'active_storage/engine' + +# TraceApp is a minimal Rails application inspired by the Rails +# bug report template for action controller. +# The configuration is compatible with Rails 6.0 +class TraceApp < Rails::Application + config.root = __dir__ + config.hosts << 'example.org' + credentials.secret_key_base = 'secret_key_base' + + config.eager_load = false + + config.logger = Logger.new($stdout) + Rails.logger = config.logger + + config.active_storage.service = :development + config.active_storage.service_configurations = { + development: { + service: 'Disk', + root: Dir.mktmpdir('active_storage_tests') + } + } + + # Override to avoid reading config/database.yml + def config.database_configuration + { + development: { + adapter: 'sqlite3', + database: ':memory:' + } + } + end +end + +# Simple setup for demonstration purposes, simple span processor should not be +# used in a production environment +span_processor = OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new( + OpenTelemetry::SDK::Trace::Export::ConsoleSpanExporter.new +) + +OpenTelemetry::SDK.configure do |c| + c.use 'OpenTelemetry::Instrumentation::ActiveStorage' + c.add_span_processor(span_processor) +end + +Rails.application.initialize! + +ActiveRecord::Base.logger = Logger.new(STDOUT) +ActiveRecord::Schema.define do + create_table :active_storage_blobs, force: true do |t| + t.string :key, null: false + t.string :filename, null: false + t.string :content_type + t.text :metadata + t.string :service_name, null: false + t.bigint :byte_size, null: false + t.string :checksum, null: false + t.datetime :created_at, null: false + t.index [:key], unique: true + end + + create_table :active_storage_attachments, force: true do |t| + t.string :name, null: false + t.references :record, null: false, polymorphic: true, index: false + t.references :blob, null: false + + t.datetime :created_at, null: false + t.index %i[record_type record_id name blob_id], name: 'index_active_storage_attachments_uniqueness', unique: true + end +end + +ActiveStorage::Blob.create_and_upload!( + io: StringIO.new('test file content'), + filename: 'test.txt', + content_type: 'text/plain' +) + +# To run this example run the `ruby` command with this file +# Example: ruby trace_demonstration.rb diff --git a/instrumentation/active_storage/lib/opentelemetry-instrumentation-active_storage.rb b/instrumentation/active_storage/lib/opentelemetry-instrumentation-active_storage.rb new file mode 100644 index 000000000..c034f140f --- /dev/null +++ b/instrumentation/active_storage/lib/opentelemetry-instrumentation-active_storage.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require_relative 'opentelemetry/instrumentation' diff --git a/instrumentation/active_storage/lib/opentelemetry/instrumentation.rb b/instrumentation/active_storage/lib/opentelemetry/instrumentation.rb new file mode 100644 index 000000000..b736806ca --- /dev/null +++ b/instrumentation/active_storage/lib/opentelemetry/instrumentation.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +# OpenTelemetry is an open source observability framework, providing a +# general-purpose API, SDK, and related tools required for the instrumentation +# of cloud-native software, frameworks, and libraries. +# +# The OpenTelemetry module provides global accessors for telemetry objects. +# See the documentation for the `opentelemetry-api` gem for details. +module OpenTelemetry + # Instrumentation should be able to handle the case when the library is not installed on a user's system. + module Instrumentation + end +end + +require_relative 'instrumentation/active_storage' diff --git a/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage.rb b/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage.rb new file mode 100644 index 000000000..a671fda42 --- /dev/null +++ b/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'opentelemetry' +require 'opentelemetry-instrumentation-base' + +module OpenTelemetry + module Instrumentation + # Contains the OpenTelemetry instrumentation for the ActiveStorage gem + module ActiveStorage + end + end +end + +require_relative 'active_storage/instrumentation' +require_relative 'active_storage/version' diff --git a/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/instrumentation.rb b/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/instrumentation.rb new file mode 100644 index 000000000..95cc28e5a --- /dev/null +++ b/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/instrumentation.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +module OpenTelemetry + module Instrumentation + module ActiveStorage + # The {OpenTelemetry::Instrumentation::ActiveStorage::Instrumentation} class contains logic to detect and install the ActiveStorage instrumentation + # + # Installation and configuration of this instrumentation is done within the + # {https://www.rubydoc.info/gems/opentelemetry-sdk/OpenTelemetry/SDK#configure-instance_method OpenTelemetry::SDK#configure} + # block, calling {https://www.rubydoc.info/gems/opentelemetry-sdk/OpenTelemetry%2FSDK%2FConfigurator:use use()} + # or {https://www.rubydoc.info/gems/opentelemetry-sdk/OpenTelemetry%2FSDK%2FConfigurator:use_all use_all()}. + # + # ## Configuration keys and options + # + # ### `:disallowed_notification_payload_keys` + # + # - `array` **default** `[]` + # + # Specifies an array of keys that should be excluded from the notification payload as span attributes. + # + # ### `:notification_payload_transform` + # + # - `proc` **default** `nil` + # + # Specifies custom proc used to extract span attributes form the notification payload. + # Use this to rename keys, extract nested values, or perform any other custom logic. + # + # ### `:key` + # + # - `symbol` **default** `:omit` + # + # Specifies whether to include secure token in the notification payload. Valid values are `:omit` and `:include`. + # + # ### `:url` + # + # - `symbol` **default** `:omit` + # + # Specifies whether to include url in the notification payload. Valid values are `:omit` and `:include`. + # + # @example An explicit default configuration + # OpenTelemetry::SDK.configure do |c| + # c.use_all({ + # 'OpenTelemetry::Instrumentation::ActionMailer' => { + # disallowed_notification_payload_keys: [], + # notification_payload_transform: nil, + # key: :omit, + # url: :omit, + # }, + # }) + # end + class Instrumentation < OpenTelemetry::Instrumentation::Base + MINIMUM_VERSION = Gem::Version.new('7.0.0') + + install do |_config| + resolve_key + resolve_url + resolve_payload_transform + require_dependencies + end + + present do + defined?(::ActiveStorage) + end + + compatible do + gem_version >= MINIMUM_VERSION + end + + option :disallowed_notification_payload_keys, default: [], validate: :array + option :notification_payload_transform, default: nil, validate: :callable + option :key, default: :omit, validate: %I[omit include] + option :url, default: :omit, validate: %I[omit include] + + private + + def gem_version + ::ActiveStorage.version + end + + def resolve_key + return unless _config[:key] == :omit + + _config[:disallowed_notification_payload_keys].append 'active_storage.key' + end + + def resolve_url + return unless _config[:url] == :omit + + _config[:disallowed_notification_payload_keys].append 'active_storage.url' + end + + def resolve_payload_transform + if _config[:notification_payload_transform].nil? + transform_attributes = ->(payload) { transform_payload(payload) } + else + original_callable = _config[:notification_payload_transform] + transform_attributes = lambda do |payload| + new_payload = transform_payload(payload) + user_payload = original_callable.call(new_payload) + if user_payload.instance_of?(Hash) + user_payload + else + OpenTelemetry.logger.error("ActiveStorage: transformed payload is #{user_payload.class} (require Hash)") + new_payload + end + end + end + _config[:notification_payload_transform] = transform_attributes + end + + def _config + ActiveStorage::Instrumentation.instance.config + end + + # add `active_storage.` prefix to each attribute + def transform_payload(payload) + payload.transform_keys { |k| "active_storage.#{k}" } + end + + def require_dependencies + require_relative 'railtie' + end + end + end + end +end diff --git a/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/railtie.rb b/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/railtie.rb new file mode 100644 index 000000000..0863ecbf7 --- /dev/null +++ b/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/railtie.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +module OpenTelemetry + module Instrumentation + module ActiveStorage + SUBSCRIPTIONS = %w[ + preview.active_storage + transform.active_storage + analyze.active_storage + service_upload.active_storage + service_streaming_download.active_storage + service_download_chunk.active_storage + service_download.active_storage + service_delete.active_storage + service_delete_prefixed.active_storage + service_exist.active_storage + service_url.active_storage + service_update_metadata.active_storage + ].freeze + + # This Railtie sets up subscriptions to relevant ActiveStorage notifications + class Railtie < ::Rails::Railtie + config.after_initialize do + ::OpenTelemetry::Instrumentation::ActiveSupport::Instrumentation.instance.install({}) + subscribe + end + + class << self + def subscribe + SUBSCRIPTIONS.each do |subscription_name| + ::OpenTelemetry::Instrumentation::ActiveSupport.subscribe( + ActiveStorage::Instrumentation.instance.tracer, + subscription_name, + config[:notification_payload_transform], + config[:disallowed_notification_payload_keys] + ) + end + end + + def unsubscribe + SUBSCRIPTIONS.each do |subscription_name| + ::ActiveSupport::Notifications.unsubscribe(subscription_name) + end + end + + def config + ActiveStorage::Instrumentation.instance.config + end + end + end + end + end +end diff --git a/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/version.rb b/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/version.rb new file mode 100644 index 000000000..1d0f511fe --- /dev/null +++ b/instrumentation/active_storage/lib/opentelemetry/instrumentation/active_storage/version.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +module OpenTelemetry + module Instrumentation + module ActiveStorage + VERSION = '0.1.0' + end + end +end diff --git a/instrumentation/active_storage/opentelemetry-instrumentation-active_storage.gemspec b/instrumentation/active_storage/opentelemetry-instrumentation-active_storage.gemspec new file mode 100644 index 000000000..cc7e0206b --- /dev/null +++ b/instrumentation/active_storage/opentelemetry-instrumentation-active_storage.gemspec @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +lib = File.expand_path('lib', __dir__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'opentelemetry/instrumentation/active_storage/version' + +Gem::Specification.new do |spec| + spec.name = 'opentelemetry-instrumentation-active_storage' + spec.version = OpenTelemetry::Instrumentation::ActiveStorage::VERSION + spec.authors = ['OpenTelemetry Authors'] + spec.email = ['cncf-opentelemetry-contributors@lists.cncf.io'] + + spec.summary = 'ActiveStorage instrumentation for the OpenTelemetry framework' + spec.description = 'ActiveStorage instrumentation for the OpenTelemetry framework' + spec.homepage = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib' + spec.license = 'Apache-2.0' + + spec.files = Dir.glob('lib/**/*.rb') + + Dir.glob('*.md') + + ['LICENSE', '.yardopts'] + spec.require_paths = ['lib'] + spec.required_ruby_version = '>= 3.0' + + spec.add_dependency 'opentelemetry-api', '~> 1.4.0' + spec.add_dependency 'opentelemetry-instrumentation-active_support', '~> 0.7' + spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.23.0' + + spec.add_development_dependency 'appraisal', '~> 2.5' + spec.add_development_dependency 'bundler', '~> 2.4' + spec.add_development_dependency 'minitest', '~> 5.0' + spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1' + spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' + spec.add_development_dependency 'rake', '~> 13.0' + spec.add_development_dependency 'rubocop', '~> 1.70.0' + spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' + spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'webmock', '~> 3.24.0' + spec.add_development_dependency 'yard', '~> 0.9' + + if spec.respond_to?(:metadata) + spec.metadata['changelog_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}/file/CHANGELOG.md" + spec.metadata['source_code_uri'] = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/active_storage' + spec.metadata['bug_tracker_uri'] = 'https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues' + spec.metadata['documentation_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}" + end +end diff --git a/instrumentation/active_storage/test/fixtures/sample.pdf b/instrumentation/active_storage/test/fixtures/sample.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c01805e89c1684e79130151abc23bb80401583a9 GIT binary patch literal 18810 zcmc({WmsIv+65XQKydc}jk~+M1r6@O-7UBi+}#~QZ~_E(cemhfA-KzJlF6LRnKS2n z_qjhV4SQF=rM*jd*Q!-bA}1_L!$8XfP13b>x^+-^mNnMZ1I-Me2UzQwL348h=%fs- zj2%n>EI^YyfKJrZ!okoEc(>4XFcdb_w>B^Y@bW_2JJ=cOT0%R6q^l3cd=*7*+Mv4a z3qB5;hvSXZo)0r7C$^2~IB0Ap8<(-8)>=QCWEg z?0(nN9)Icelh)1Z%-7YCn!8Bzr7LUB?@sAwWnVpRAKciyREM|tXk}WdZJ1iAcRU+Y ztS3s55RR+%GoFsI8vX8ibE#DJC?B;TcXp_*oNZQGFA(f^LVK^QF5Mj2S!&#_HokIQ zT_@h{A@z*Z?-{e6<9G~-vQi5z&~p#Le6L&E2%O`%FSpaGE?s&`xovO8RlnkWc+z#B z3*SMde=Uww=|%|Asbc6VBhh)2_S7)n8nMH*Gi#-cf3)~8)0o`Zx-~JpUWDUp*-X2+ zpm$(&r%!Ysq`obwd7wAS#kw~Eq4G&+$?H9&*xo0&man*9%a$)3`KERn*YWPoICymm z&G2O_zjj}$We!=JNGx^X1^Tl&FdVsFW$*77U~y_9khGE?J-o(WR%x8;qCE{o-dQ7M z-mZ%jJJKb+1D7hh(hQJ2C13OiLYUi=y}BOVY{v19fy#W*u&fDoYs9W1TZ!-d=2|VI zq7AA6M2x%N#~058EY%Y?r2u(1mW6pg-%4kha;eeZk!Iw=`(d-`$TN83VM?stGQI4? zS<8bRM6+(tFUhEZGx)gNegVYs=YE5fY<0K)Jrv=B84iZAFBPZ4l zg}PRtc_mr5UY>mrS!I-uquWlJ$A4K>(Z4$}nhv^uJ?j=r60zUXP?<_t2n zBvieLwS_%I=xffSuhzlb0GIJaPL(>L`*66P(8hJ3`}L0LCu$THxWZ=Urp5IsX?HyA zd9@pb7|g~s*a4_!b zk0byo3JTbohI@=>N9vpjd4UY=hq|)^RZolP9R1=k8-piZ$L>QnaU3TGlF}WnF2iy)lxL?(}1Tzof`y0EctF|M92$0lX}<+Z)*dQt4y%~qJU08 zJl6oQB_ni(tkEZ>%Zj-yECFQ>FVs#yZebm=$1~(nG{Ue&!nN}HQcyRee=Xo!NFD=N zWpbzmW9@V$@aScl-mDL7zK2i<%SkXxv;nn6hMH8i(FG`?6djl?x1tA~ zp-cEoObufO#kuYN--R?|B z6WCDAyXF=WnsEeeUCzs)k8)`2bAa@nBj<#I@qOa`6OriitR?s z1+U%$;pyCxbHrt6<0jRLn<^J<1{1PJlcI@_kvciS+%S<)|Hzpe*j7`t%wIW;lY#ba zkQsBXY65t) zVi)E^RRC29(Xso!fx7Qj=BxlNxpr+D%(;+?jyl9JVIL{70*TZBCWx7F)&oXql}Zjc zVT!1I8lazmTudEBofHn)JK+U2<@a%4&;!@NH^b^_ZOjgjHWu$E4CYJ*C(EE=v=Uyx zs~b3r7s<7NUsmVBo7#uet#%oLQdibuhiiV>8?{Q>yz|XnO^scU^#(80vrlq_RhR$*Dx!{#O-^E-8$FgLM_gj7O_74>#^NLs({B(#1DmFq zRLGp;*CtGzBtioM_bS-x%_m(kOSX&jF0rGnLWJB1hFFRtsG?F(F~O%SHNYeVAXJ&s@Q%U{W3MMgueC1_gT zZyaj4$|Fy&`*@Cak2Y^nQdYC8CFnAJSQU3C0&}6GsX5VBPY&%6sBa5ve??K!d_wHA zJ@Gp2Fz7MM+%bo$+Yi3n6uDU%CI3;7zR5|oncq;CcWCk{*ddCPnzxNz$AIXCY>pa_ zFY-8{Fa+MWXpSf;3>N}M&ggDx5jsW$WmT4kJH_v6qMOv+CX?B@-{^?^v8Rj0(4&^> z`;ZI!@lVEP5%?7m31>cjx=H3384$&-A>_9WW${!!e^aEbS8D<&;O8&R+~#GMlkwp0 zjuhJ^8$&`T@GqKzTYg&|ZR6dbNBC%IKEe*;blJ2?!6;AAF0UPhlYdSCrU)HWQ+ql$ z?C%dp)!s}cS|}G-yy@;u*ALxX4IHEntDX^Tj*qCg?n^5O?oq|R9$xd!WXPjhN0b{ z$i~u^JcZMBtnd=o7@3_{Fs7#;;g918a6EN=q!GFOGz%zfijqGEaG+yB=~ku>L?>)J z!{pV&Z&`wV@2nLsydf-LGY=&R(({l1NXM@#p?XORj~k!*RvGSX3;MW8wHjpa0^=kh z7+N$7CtfHmPTGP?kqQ~Jg-2Y*@GeCzND<{2cG1)BJoj`XmAF&8s9@u^Due6{xk$ZH z07){cy@gS(7E8BLwCShP{EO(lP74DGO4J)@xzND|J*e@P7x8rRWTn0Y{bH)5MzX_x zGz_{i3-6R-<1J(?>j|P#>`n_N8-%t$*rMtSiAQJ`beG~rmr9vM*l+9BvzT^y2a1-T zcWmqq&9z}mIas(BOg(1ZF_49*<9|i!FE1TS=yO#OHXn2d}|A(`Z9L?X?mnWv(w%~;5FuVKD@L|$KH;^c3shL1$3&f&14d(qZ#4& zy;|DplEGAxptQid=z7mk-W7Z_5Eu9arfjQfD?7YhjbK;QE_*LlOXP#KWCICrq@oFvU?A}+y=;8dL1M+C zMJgN^5;#ECVXbC^WZfAQ{>)NW6V=0l-Y9qQ*nUuJkjq%d4AOA*&qY z5^D)xipW2-mmBZ(X7)$6^6Lg3z(ZKI}KRi;nrm?-kLFcgWm%!fqy?rslb_`y+G%q0Om)>aW6Ck8^7ln(8T>W&6=cM`uSkMo@o!vdAU z$gw##qtZuz7vj|nc#K%tEn`jf%deOb>GK8-S&!>nL@spTN^BohYgMV**=1ja=s#_P z9}Pe1gnM>ge~iVA&;^N?w(-2h__yZ&ZL(kay8Bjmpnb=ubpJSiHjKAS- zMHd@G0G*t!@sF#Wp_K!G=_dx4H?+5Qw9_}V2eAG$2w7V>0ORce&$t~3(xnXzOmzjV zodFv3Km#iSBY=&AQ41P~)BmXFIo~gQFK1`1uVCl^&;V8@EDE4gG<0?VXaVSitSzkV z6l`?$4FS(IfRH@{fbB=|yu3j853KQrS(Jg69>D%=ho%!{0)`o$t9&L37=dp%er5Pq z)eH`pgyLxadyUdVyV~xI3ytH6JEri=h6Boj!I4zrAp_1xFil#z*10m01P@icg zlkT|ch}o#s5W8`GiI~sZuk$guX0Iw4H^AeC6XoC`;xYK{NtGVLj*pw}lg8W5*fug< zK7&A)nNs{qj538)H-8?M)e+RP?vsTOd~F&Kp({lqlQ4VfuE|*r`@Ep<3{zN1SE3vR zFbwY#KB2IAbLrx%eKLZs)VeDJx=n7N?R!G2e z^N!#tt-k-5)b_eQcyXBg3U3+-$2eEsN7*%8rAKz7{-pcb&;oPR+q1-J*3JECZv)M7 zww9OsCfs$AqpUd{M@d)N)(~dtsh80|a-NK%pnWo1P1StPX%iu3NU8#syvqxmH}N(G zMQL&R=v$o#@{k-awFOCoq@oqY)IN{jo08X5b1$51V!Ei+U)L#^H*h$=pCfd&ypdL^ zI{5H-d+B<&aEfO+@R5QXW%#qOQCy`)?&gy7*9W6$q)c|smYwDh_5Mc*5k$TK4t2^? zRHbuextT6&V|Y)TT2D>B{GAJd2W}{y(#-Ml-CU#=SOhYuY}~zh@J0s!9k63F_J#8UTLG zCwYL@uQbnV#INb~uO-C(pB9DZdF}|D%fN{zX=-2(Tm^p4MXhI6?~m1j;qPS%={o3I zSR4ObpX~own10Lg9|%N-KN!THbDjaf#LUF_zo&JnvZaZ}EEeyMrdmwCc)}(XMS_Le zY?YOP#7rT{d=Z~PZ`BsN{ry|6h7ZI}_v!P+i46okRu>(tj1Rk~#rYNZB)9>Bd({Gd zW|u@^9%EJb9~}8=4X6XqdN6bOV&Hl#zHz8jsRdF5NUx8(tX!p?Enji(c&tzfLJ<`9 z(ISaEnVQ?CHi>7npPFYiIoS6~3cEu+usRIyUoI&3G2X)LzK7ENUT(Rp9o}M9q(dng zbhLLnuzvcE%L8Mr0_I@yfZoKb`w_$g#r5uXW`yRh_*`iBDl3rfovQj&FKqFc7xcsV z%zCNiHil@H7wpnqO?PR$*Tbeh)p_CA##g$gI-%tpwpR?`S?{e^ROgpTKXB~Aj9t9w zPV|yNqH)2LxIWBqRd!kA3%yk;qQ2jxX z??LZ9Z0qw*iit>-L*7hj5Hbb8-SfVSdZX6uL0v{ZpmsfO!#C%_o!wjTuB*TshKxJ>#$p`nBQ=S$%yw*$r`5Hf-m6 z4`=s+C?R6x$gbn=IP6HU?gfQcqaWqXZu#DtJu=3zx>LNN>5cY`kf+kCwRvMnrm%kp zDj111lF@c-6~DHGf@yV+@WJJlF@}Hs0k)d}5tjkkKmv6SHN5*FM(I?8gldUvF~2eJ z%PtSkgOpbg?zD%gg|-fUwsLBpa&ld+8@Un+l3<@Dj03;BCTT;jpX27$@dJjp7M?>c zvBO*r5iUOhJp_3hgbmI$-Z8{6{4vNeflfnM-%wB(VO1DQ@-cm*i4iY|9-pM6NYeLv zvb~x;VfV`eFj+jf<%Ws$`s#S(d5=+*BkIv+#>sZP*Lh%{-(#?bC?Lc0L#-Ej3Ef}h z#fz13L})g?)Aw0-;p8qKr_3idM{eEOLqIqq^hoxMbqa+vb;TWyx9_VDD$-={mo%Js zNjn6Hwbz9}Fu-RG<2=?aKGg-ouO;HOSnY)PFBc`=SL!GuIGJ&iEkshUgva)hF2EI-H=HIMJoJu|a%IXQ0<{k60sT!t+sZ1|&(g8}*6+*GMSAjWOVw{iC>H*%W= z1JtjhJ$hhvewesBS34iMb2Ay4f@6_RZ}G@Y6lE8$>LB}Fvv2qc&^d)l&U39 zUxxu7&wyJx7Az;bbuzL4j>&)&5wl^bo#y)?E0tE(SoDMK!kFe#SL1uZfmG>g?c`Um zh3>AT9NZ9v&LON~w+ni?wiq;Z3Mj!kvTlAET;; zmzUy`_2`Y_rs?%Q5fF_YMk)sU^^`kImQEC#yW+K&EK(~v+fA%W854ZoDr~A)b3%A0 zDXUo1?rCqsS1XVLEg>=q4Uiap7CVY7!l}HYRhr{O<7ef`W5tc#jrN70Z}L5T&L$*Q z^re#}o3r;k=i@WJ(JV5C6qL&t(srethj%Jv(=ee+X^J<%%g@pZFW3*xXXIDD&`QZn zj}MGsL z9;_VB25SDY*Rnn2<*1ma)3W)ZH(o`t2Kl)DAYQO9810F6a`lYa+~YgKR-V!kjBHNL zoRP$Vpb@#&*Kgdya){;*5R8apO``8|n*$(>QuZ(MI`DAy4_BjZ1yM$CQuOC9J0TtN zJm|;mI2Y;gTf_?e>YdNz8jPdnxBPd|(r`Hvi=-x6iFRaS0WO779j~SY(#%>oY_OL@ zZ~Cl1tO0cUAZ*$##cp~HwZB4y+10!o+?_pr+nO+5Zg_5v^`I{L4?&18_Yd7nYJ%+d zaFj(&^XBr@N7bY}OWs6{rkKV?auSyB*%~$Srl*WlJG&Od7>_viLy$i14TNt` z33D^xS=;sWNHTLV;&6J=cwDOUuEJhcFL5Q2dmT9Gd9ow+Q3T5vR>$rXL$AH}E7!8z z^$;!X$kZj^dwO&_INALuMVN~(P_DAEg)&Fhqy&ZZ#pvQ#EZ$|9WEv%t;}&yIAtno6 zvr{XkATx^j05T!y<-AWlsa>GKOR)Y5(wdQ!@mJcUS4AI|b&;GBmoR1mygq4%8=#C@ zf_-{oJI)EX=H31@{?%-BW?e~y^n=lvy?yrm!1i!_dU$?!aD1XNr!m`mD{AdIRgIOk zai!*{0fg(PbQE6ExtDeji7CQYc%&|NNQO*)ulX-x$67%SUXtaWqU!Yye<12hiIC`g_1afcWe=T1M9r2$N(4mBf{msl*K} zoD3aI^>t+o9Sv!eEFA1~rJienrjr0VYo_`FR>l^FK<|)F!NJf{8Ndh(Ng3)Im|7VF z7}+C1h34`B{8!H|e7T^>9 z(}#Yp@~=Mh54=mK;Hc;D1C=Yzo3Dgr7v%7scZGi^1HYGd+UDz?4LmV zkG*^b06WwF$@f-sv(T7z;oH%Si4i{`2|+CyEF_Ov7eXcpK?p{sScs#RtfJx53yyeK zMc8ZiP1t2f+#B7|hgK+n#x(S3+DbBkR3nx!JhdZ$5H>i`Q5wghSf!*J8&fniM`#S* z1icz2p=-)>rMampja}gJRdD20n*Dd4ox7H^JMF+QrXKZq5z@+&{Ik&Fdz|%GqL1L` z&G|405Ncd4VO~fcOMBCeqhywik5~`o^rW;a9!G1FBW%mkYctgP=>bfGq3<8wQ>GaW zJ-Kjaa`}OD$`Ui(K6!gyC7&ViGCwGFwq`%spFgcHHcN(HJ)A38)1y1TdT8Fkz*k4x zm>@X!^7cH==sp`1;=1Av<;~D7ns&o?mir=hRagg}F~?JUMOR+NxS@M)+H8c_o5))_ z)HY)aS9Q}9#OOX4$uHYrxY^0cxj3fZLuv@uqaFttKIHF+>F0i}%CBssu<-q<@-yqU zH(vTsH)m3+iz*pjbaLWNQYLttVUS}b{ecnE1RJL8aLMO{`T%SDM-$6*>&G?D;#=*m zhKb;f=7X?8-}d16eG*S(+~^K|LjQy~Xc_Go!dOW3j+#|<8_O##^Y;GLbCw~SS_ZJP0l6nQ?mXGymvj>2 z^#KnsiL}aFk{i=0uc5)oXtk0x>KyVZ1I<{t4d>QTUwavKFRj)?apNG@t(1(|A=>MN zEG%FT2WJF*pw&{-h@AxlGa|#6+RtEm=beY4Cadmj*uyxObH9!;1-yn1Y!fRDsn?Ka zg2W(glL%sG@T`6#tr509uUug)uW0t@uV{9|PFdqg9lub^-Yk;ubZkKsU%RB8zZNOC zoA9C6I(IGf(+9d`(as1kO*;2%iZm8B~9J@{6qGVy}^53_@K40doXLhtn+ z2p+qQ9*yjAt;YgC>!%`A4jxjMkXK~Gic4fIKzM6{U+5R04|UNi@E#7;QRnol#Z)CC zkkqx*luo1BC68pV+!!R%njVYB&>Dt_+)tz-$FiZ4WsUT+q81lM7)TmCVu^t!o%}1xb7#x#ihrXA!wlCdh z+$P?@u-VO)>tnmKhg!9eWFYeC+d6rI61-Zo_mCy;MVu1C#cJ_mlCX^~M8v zz}o%JzXI-oZ@{ZO{y8)2ger<1!qmVScU`j9Ql}?qg4J6rV=uNt3w_PvDs)IkVzU$d z{7%^Eqkqf0Ah79z!`}Zo#K#IPZmdg+)9)jP;Ep)8pk7iIzVCKI+qf_7Sj+J` zJQ6D?#OL6dVe)ViyVWV;Qfai#t5Y9z%%iOSu5f)r^lA|n|0>yW2E-AIfV21w%fFcVc2bstBxl(IBXB zUwRAjX!79s2us7(!6jCQIX*+LAC3+|!@@FS(t*8BiP(#l$6`5*FhpUw@V2jDSbHn* zVDxl!eCj@mlWDjaa?%6JUa~}=Ybf4D=`Ne&QgM%m`$HtB8$nNj8WZP*9!l6R z5}9d5H1@gq1L?M_Fw32!ylQBz_)qB{moHkasq9J?uk8iS7sAE5A3jMnwoP`f_IDXs zZ3PRmTjK6DVi`0+6FzmcBiVNIOMkI3Xo^RG$2-(*DW<$e`KSDtqWe6^brtlT1|t|_I~*~s)&R2Zp}h|>mc=F~)j3tIwzmbibS z75_h9dR+`n4Cf^@Vzr6d}5>5=Z))+joqm;_*9Qc zC1cZrqw(I`53L>--dDQMZHr4&QI_x*?s%giB&R|O5qm>+RCkztT>7*?i0#}q9yOCa zr{7s)3?gCYu(|XtzHKCaFF8Kl=M&qP_cl7#@I6|iJBbCc{d@V`Pr4pe%$Zltr)MM) zJezNZxO^{CE9%T34Zx6R7@6ZT@c64YbSbE@oX>cd886}Z;*;WS218+3Gp{GQhAQZk9dB< zMGjSwc1(r=AMn$$$6~;FQMwRUzya)Y$@^vA%8Wsz z!EU;2dCxuS`w86Pt`muG#Bx8E>yQ?NX9M@*dIV&8y0RaAlAnJ4oK2V2UYN^*kkw~I zHLbWWa7qos--2-w@Pi^qHPJcNBYLz7NOhS7z{YOKZ8myZ>a*8(X4LRmhnDywajIZ; z`J+m+N`*86o$wb*$1uX{>9;#nsTT025nObN@rIRoOk9EYxlfQ^_kBwL2-f}{d}|SJ z1Rsk}NPp);F;R=3@}-lt$Wp~7wcqGo&a)G&9W}MXsf?g5Ix{Td)vSCyJKy?6#1KYv zfI}DgwXK+Y(|a4jJsV;&2)Eu1_>Q%rMR7YLD8x(&HFqew??o7{m+^X)6D=7%@tR5) z^tU)V%u+5%Uwqz_hrFSa+XJU;=Fi9Ycn%t`oizcY=<4&k(d>u)BP{y?|4U*hE)oHYRQ zm=X-KnqDn<1N2)9k9P|xwx_rI?c*sI5uhf~RKx3Vk)03FNJh5A7>S zg!dFdDhJ?P3$GPE;ec}czd^pi^&o%G1Y6YhLgx0RSIeXCNGxV}`yto<%9sWXHwd#;HW>%K)2WhZQQyq3V*g~H*X8JUU z50h;+*qAaujHSBI_Am6@g7GirLBEkrYtjU{P8GZ%o^NwRR*jhJ9MPyq8#E@r=|J!8 z@Z`@T) zu&c`iw}rG|dEZuTdr^oS!2`*lTkVjh=!+E}jbP>ftltqrll&d$lo44&L*6H`{~ zR6O|NIdV`O#XP5~2b=*PRH$(%0y$j@(D|%J8AK7}hEL0aC*KUZH$_?Hz868&pwPK` zvkxpyhiQq_qlnAteFULxQQgMXp-egXlJHf&(f%ga@>o-x(JeRLb3Ppte)`?|XOBs& z?>2l0FHrP#E+$u_M^N;>GP$66Z_d7IhY+ktY1X$iCjIKK)H|?M zy0|!=G}!Otd9C?P{oL#WPt==_Qe$J*B8_OFwd=%!T97zqK|N`Hv?M9xIp3lSYK>wi zQQx?#PhGr&Cgs=>${}LiM8T>WOtte+OlO67w4O1|r5EQp%nf|FD_u-2S0cV-WDUm` z+F&R>(WuE*xkQ14M4cmHEew;Vh=9w-@Cq%-KGDlPsp1r*YgkKNS_pMWB?L{^OG=gw z#>jghM@0rl)tjT1z=~%`sVlg46%5|j>VV7hw~cjpqwT-I>x}g24GY&;3N1M28m$n@ z4O$x+m%3Fbs@pwOWRV5@_WHEuO=>a`Zh~L(sb?gy1KaXO`?YY-EZ))g62AV%#`o~x zP7$-2+r4xMMyooLXF5?#Xjkz3c;vgp8GN)yd_gw|Lavv!;$-mFe&^WEa`!759YGI{ z{L$q({yq!qS@f*?vBfBESvCl$-`j_jr|Hz!FiMY&m9Isp?sL#Q$DvzI0^U`3{4|ID zG%KC`2(*ECnFyDOnK5_3jLmb`d|d;pcX~N#<8WiS^HwpzHZft>M1=;$O!LN(=IeNw z8V!~pi;x7;qi2?;Go+m^WJQYJilV*lsa+R@Ko~csRts~0>(E1dQLm`xW!j4kxwc3WS0&ZU^kt>sDS|7G zM1vulp~^)D148Q+E*cUJ^0q}AqY;Hv-tNBPSBaz3Rz4HCcgx)k@om^XDRRoHE%^Mc zeq-1qOLR__Rx&R+o;rFzFg1DYGK_&I%gf6^MB;=)?Cte()R& zV{co8RIFOQj~wmkRWoJ8Bh2Rr6c%&s#Z4k%@I^WlF3l(f1-OEZY_m3ZW9{-AT9kxk zvRj0rqG~^7n;OpWsbqu5pe~Xs`%a7**R--j zWt+|}p$>Mx*K6fGxy@hUX~3DN7+7N&@bL+?g7Zo}tn%zl4-=p5$xLU?m+X|&a{)tqw&N*UjtyiP^F6TnNmd1vglOS#4kedQDkgW1|9=v+W}xp6~^ zj!MEBVvbSvw!tnKOBmV%!QxzG)1J=iF{Ug@KdvXv?HoR1M}&32s~xl{kY$`_ii_9> zV@1L#rnK_vTH?{rGoW>31xe||<)q+TY0q(wXX*Wg+Xc>t+zsWri<3=XZm5P= z%s9qQ*?Qh?L`oMI6sj9*WLkRk9(G&gb&}sP8^QZ3!Vw_nx?o)?!hK;m*Uzdp{=T@_ z0v*AeII5-UX=7+=`~4K3`f8+X(PO*4=c~n8`R-HGSN9yuSj5|J*S(w}7Wt47B;B`f ziQy_>2iNADl9c9O=6wbKc4RbZ@nLwqHQ1w%_v$m)A%Lsvh(Cd06df}L9}_VwnB)mx z8b(F^KQP75oZB;t$PDbrUt8%w()B-4i@(u=e=^0aKu-2|rWnZo{a=`3W~OJRm>HcwOXOj8%J0lCw#=`oe zOa@?m&woJG6Y%<6!*fl*Sm+f8q*DLydFKDphkvD* zp?{1v`9CSlPlRyUQ^RLDdyX!d2z71z~*k5#~l z?%eH)+erOR#@W-8=TmPb6p8;_pJ_+zL^R4-ar1}|Mc91=;y$OH8O@u8W0G@OOeUH# z+Vowg!$-7RFA{&QFAn!*-8Vj0dd}zU1gAZx9rxpGgq6I4nv+SH8a>|h#x8IV<=Ob} zcq^TZ53TIjZe?@%JnlE6Z&uYebix+33#tkj=9$lmRCXVJzZ;i4VCO+wZZ*|y-6=uNBAQr-n5s|3gWYa}SI z!R#T@>^&0)_xvUSgxt=2hOzvt?!w$g*6Xga=6F?>20X15dk3Bdss?T^ht9aM@6Ht! z+TX&hqCDc!G>xeSM2oN&t!NdCJ5_tTX4PNU^)#iBeP$WkHf=#gF; zjF+g$I#ON^IjbAYi>$y(VG7$O&l)HjW<4<>6~IH;9S6V(qF?}bRUA~+kdpmY943Sk zU^;QS7xm_Ah+Y}oz6599=@XRvov}~#1(U%3+{`(&c>36UJHSy3cVe#aMMJpF9_6b{ zRzzM8H2)=hp`;sDv8tercK})!Ld4)UN!K-*W{(G`?jqu}kXWl}naRl-u022H+k%=8 zY;%Fg_+?kI`p)I?7Hc7B4FaEY%b&1QB5#Zy?jm)=h+df-AsvC91|+(h!lbfa1pDew zNj-Xx93Wa*F$c-n#=IZ~$MQY&Q6!*>Y6Pr!rv-3>xxk;|1aW_nxKFHTg$R zT)1HMp|#TPN3Ziq=g|yns3|EN9x0OL7S({~b0Ef{rg^8*=)4kJPI|Shu|=yn@~vT` za(+C%XlhI8sI545rKzUN4tLTE>NYeFY5s~fSwlC;{ZU~(bnejBX ztgC^iA>6ldy%}NS@C~96%N{)+Xl^w|q~91MG<}h{>;y;PKTSlON_60h_70uu5&@+} zwgHA-Y7(y!f?z<^iMRb`!cBaT>vlr|MdR{zTi(O&xWx?DXO4IqzZqQ3lhSSiq3+C} ze~SEiN|5wqfmlM&E=ns3EJ~!0qHmTUlD`Gv25QqKh#T_aoxp}Qq7{4wCwy8`VMM2b zSkhA#Pe+p&)iDGedV37&VN)SZhv~fLvT-3^c>;|*SGXf7q!W6byU#37!{kUZIO_r! z!ffDKKn_RRh=`_HU|}v%m27By)f)emIQLaIK#YP75jMz|SX?_+30+z~6mb;ot3qri z<#25cUdpAD$dXpTl5Q$8oW@?I38~3v_72|CL9=}2P%_@6H`|=J4_Go4FfR6d`Myir zvha>vOwBw;stwKgG)fKMSFe}R-%&>mT)&L4LzkH1Aa%02N3fxeradi}o`5r$M1*8V zhl>!gp=RYkZ?Amy9P-sidL6o|`m&dh{a>cHJ4xP5zDkYlYFrE7ObTI-Yr47YSYH^9&t3xXY#W{g6T$NMU!O-?brnKV4#F*|mKpRi34M`X z_m`kHS_)FhJ9YC>%~2Zt8X~H0-^)7e->M&J+Bp5=3Z;^$tT-I&9At=>{WaBG#dfCd6}~y$-g= zke=4h7AtJ<*;F-B*HML=nux-3u_IrP zP4Ky^lUoTnzUY%vP*%>N<IQh#&eb$2W_^Et#)SJZ2>erTcC^~gQRe(%yFW(QA?)%GIsKtB!Taf^&= zPOVEu&~6JoR8X1@8hAaL3pYUKO z2z9D$A#^pjJ*WlN9rP3%^;c+7IqZpfFtM~U6dxYksl~nF=#W1pG+VGIPJA(*hnaZ-Sc<;~MA7Oi#R2ATxx3^FK z-Dq!Azbgvjpr+sgdumpv8RCFNwY=RGZpOSq+wTIq%< zxmr5Lv+bh1crRI@Ht9Y{gU)U0qdS4pN4<5EJA>I3WfvG+V-H=AMDgu@@hOlBwa&!q zJy50+BX?U4r3Umq+ZqhHt%;6Dc2Ch9yzW1_KC8B7cy5(Z1*m`nJDY3zB|C`7O);=o8f!R9B~PpLPeEZ1GPH)6`9GU&3}`4OID)UP=&VZEvj<}<;q zOmSTTId58-W*@hbrz5u0MOZ%dfZtzsn1+O}`@O%;oN1KkbEvCTTrp4Sa4W}*#8zSR zNHw6~Vss9UyaQpd2kD~_PYJUZeDII~I6*hny)aw0|8Sgp@m?*HYU*8qSJ~{b49){b zCn^*`__oi_AXan_^GmE-?Dvh#)i2i=QV6ML+X@LzgQkP#QgoXi8r#6kOocS=aXxHw zaO=y?Lw#79UlDvOXmlAVqaxZ!h8~fruBySo==IR?4JLUnK7Xr*$Na2UB|-~`bu%Qq!ntFV*nlaKo#>12kCK2aHjlbaBXLRQ3gtCeVWcwYPfM2V|bkX@fX$iJiG zA8_Fr`!LZnbNq>pf0vE_cO4bWzv-y{0UdL&{zXT{OwaKrI_3ayu>4g=C8s1Hr7G~B z(D6@f{8u3r&9frsrA#`m-=$PPV5Cf|pRw@I@_wS=zv5tE%pU@+ zpYp9=sQk|o|Ax2!jQPj<{~^WyZzVA^Gye%8Wnp1r0T=;(+8Ee4o>`#hAAr>#HhLxwb|A6w zR~rjG8<5!etBs!idBXnH#>Bz;HyblOJ8&lbH6086GdJ~D8yg49zuOqt*qHyleGE*j z9DlEa5xAuNTX`(>&tk&A*1^K?JgfiB#z_A+8yhp*-|Apv26AfumY0o<1-O>{wLEqP z=6^4bf$2ZmfD7hd^D;0oKacCbl*hot&i1!-z@hQCI@tdHOc~gi=zsehKq)LxvugL_ z`-~J!T@8U_13)KlZ4Es4^apJvVP#|uJOuTF!jcdM9)sd$HsoLi{)b@E)iq*ZVr1rE xH)3U>H)PW@Fl5y?&}TH_h5p}3fafTI`dE7h;JE)WC>hv+MM0C0h{%dU|35{Ppxgie literal 0 HcmV?d00001 diff --git a/instrumentation/active_storage/test/fixtures/sample.png b/instrumentation/active_storage/test/fixtures/sample.png new file mode 100644 index 0000000000000000000000000000000000000000..293a1f43b07422a77913018453baacc83c537d55 GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^DImVS)S0MfW|9^XX`~Ca(%gf8h z$H&*#*Uz6nzrVl#&X#gMpfqQJM`SSr1K$x4W}K?cCk+&w<>}%W64Cnhq9fNK1A*3u z?J1M8MfNnY&j`Klx~1%9>&@LK{u&0GOv}o=^Xm74R{IG?o{UOLN{jYC`Ly^mYwVXp zajI%x#C3B&zAC?z-TlDrj@NUKrS`l}zjEmFy1m);=hR%~sP&(!TDNow7w~1h6+L`K zH2O)yDc$o21s+`yZJzpA{pFhNefjaVF`I%-u0>DJ+4py<3lQvo%_qNAzB5Q6%n9g9 N22WQ%mvv4FO#pP4Zn^*f literal 0 HcmV?d00001 diff --git a/instrumentation/active_storage/test/opentelemetry/instrumentation/active_storage/instrumentation_test.rb b/instrumentation/active_storage/test/opentelemetry/instrumentation/active_storage/instrumentation_test.rb new file mode 100644 index 000000000..e69d0df4e --- /dev/null +++ b/instrumentation/active_storage/test/opentelemetry/instrumentation/active_storage/instrumentation_test.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'test_helper' + +require_relative '../../../../lib/opentelemetry/instrumentation/active_storage' + +describe OpenTelemetry::Instrumentation::ActiveStorage do + let(:instrumentation) { OpenTelemetry::Instrumentation::ActiveStorage::Instrumentation.instance } + let(:payload) do + { + checksum: 'BC3HWOZ8gHaD2PfLOgZP0w==', + service: 'S3' + } + end + + it 'has #name' do + _(instrumentation.name).must_equal 'OpenTelemetry::Instrumentation::ActiveStorage' + end + + it 'has #version' do + _(instrumentation.version).wont_be_nil + _(instrumentation.version).wont_be_empty + end + + describe '#install' do + it 'accepts argument' do + _(instrumentation.install({})).must_equal(true) + instrumentation.instance_variable_set(:@installed, false) + end + end + + describe '#install with default options' do + it 'with default options' do + _(instrumentation.config[:disallowed_notification_payload_keys]).wont_be_empty + _(instrumentation.config[:key]).must_equal :omit + _(instrumentation.config[:url]).must_equal :omit + end + end + + describe '#resolve_key' do + it 'with include' do + original_config = instrumentation.instance_variable_get(:@config) + modified_config = original_config.dup + modified_config[:key] = :include + modified_config[:disallowed_notification_payload_keys] = [] + instrumentation.instance_variable_set(:@config, modified_config) + + instrumentation.send(:resolve_key) + _(instrumentation.config[:disallowed_notification_payload_keys].size).must_equal 0 + + instrumentation.instance_variable_set(:@config, original_config) + end + end + + describe '#resolve_url' do + it 'with include' do + original_config = instrumentation.instance_variable_get(:@config) + modified_config = original_config.dup + modified_config[:url] = :include + modified_config[:disallowed_notification_payload_keys] = [] + instrumentation.instance_variable_set(:@config, modified_config) + + instrumentation.send(:resolve_url) + _(instrumentation.config[:disallowed_notification_payload_keys].size).must_equal 0 + + instrumentation.instance_variable_set(:@config, original_config) + end + end + + describe '#resolve_payload_transform' do + it 'with user-defined payload' do + original_config = instrumentation.instance_variable_get(:@config) + modified_config = original_config.dup + + modified_config[:notification_payload_transform] = ->(payload) { payload['active_storage.checksum'] = 'fake_checksum' } + instrumentation.instance_variable_set(:@config, modified_config) + + instrumentation.send(:resolve_payload_transform) + payload = { checksum: 'real_checksum' } + + tranformed_payload = instrumentation.config[:notification_payload_transform].call(payload) + + _(tranformed_payload['active_storage.checksum']).must_equal 'fake_checksum' + + instrumentation.instance_variable_set(:@config, original_config) + end + + it 'without user-defined payload' do + transformed_payload = instrumentation.config[:notification_payload_transform].call(payload) + + _(transformed_payload['active_storage.checksum']).must_equal 'BC3HWOZ8gHaD2PfLOgZP0w==' + _(transformed_payload['active_storage.service']).must_equal 'S3' + end + end + + describe '#transform_payload' do + it 'adds active_storage. prefix to payload' do + transformed_payload = instrumentation.send(:transform_payload, payload) + + _(transformed_payload['active_storage.checksum']).must_equal 'BC3HWOZ8gHaD2PfLOgZP0w==' + _(transformed_payload['active_storage.service']).must_equal 'S3' + end + end +end diff --git a/instrumentation/active_storage/test/opentelemetry/instrumentation/active_storage/subscription_test.rb b/instrumentation/active_storage/test/opentelemetry/instrumentation/active_storage/subscription_test.rb new file mode 100644 index 000000000..07d1b3411 --- /dev/null +++ b/instrumentation/active_storage/test/opentelemetry/instrumentation/active_storage/subscription_test.rb @@ -0,0 +1,360 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'test_helper' +require 'opentelemetry-instrumentation-active_support' + +describe OpenTelemetry::Instrumentation::ActiveStorage do + let(:exporter) { EXPORTER } + let(:spans) { exporter.finished_spans } + let(:instrumentation) { OpenTelemetry::Instrumentation::ActiveStorage::Instrumentation.instance } + let(:key_png) { 'sample.png' } + let(:blob_png) do + ActiveStorage::Blob.stub(:generate_unique_secure_token, key_png) do + file = File.open("#{Dir.pwd}/test/fixtures/sample.png") + ActiveStorage::Blob.create_and_upload!( + io: file, + filename: 'sample.png', + content_type: 'image/png' + ) + end + end + let(:key_pdf) { 'sample.pdf' } + let(:blob_pdf) do + ActiveStorage::Blob.stub(:generate_unique_secure_token, key_pdf) do + file = File.open("#{Dir.pwd}/test/fixtures/sample.pdf") + ActiveStorage::Blob.create_and_upload!( + io: file, + filename: 'sample.pdf', + content_type: 'application/pdf' + ) + end + end + + before do + AppConfig.initialize_app + OpenTelemetry::Instrumentation::ActiveStorage::Railtie.unsubscribe + exporter.reset + end + + describe 'service_upload.active_storage' do + describe 'with default configuration' do + it 'generates a service_upload span' do + with_subscription do + _(blob_png).wont_be_nil + end + + _(spans.length).must_equal(1) + span = spans.find { |s| s.name == 'service_upload.active_storage' } + + _(span).wont_be_nil + + _(span.attributes['active_storage.key']).must_be_nil + _(span.attributes['active_storage.checksum']).must_equal('9NwXsO4K/DCBz1BoXsIHiA==') + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + + describe 'with custom configuration' do + it 'with key: :include' do + with_configuration(key: :include, disallowed_notification_payload_keys: []) do + with_subscription do + _(blob_png).wont_be_nil + end + end + + _(spans.length).must_equal(1) + span = spans.find { |s| s.name == 'service_upload.active_storage' } + + _(span).wont_be_nil + + _(span.attributes['active_storage.key']).must_equal(key_png) + _(span.attributes['active_storage.checksum']).must_equal('9NwXsO4K/DCBz1BoXsIHiA==') + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + end + + describe 'service_streaming_download.active_storage' do + describe 'with default configuration' do + it 'generates a service_streaming_download span' do + with_subscription do + blob_png.download { |chunk| _(chunk).must_be(:present?) } + end + + _(spans.length).must_equal(2) + span = spans.find { |s| s.name == 'service_streaming_download.active_storage' } + + _(span).wont_be_nil + + _(span.attributes['active_storage.key']).must_be_nil + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + + describe 'with custom configuration' do + it 'with key: :include' do + with_configuration(key: :include, disallowed_notification_payload_keys: []) do + with_subscription do + blob_png.download { |chunk| _(chunk).must_be(:present?) } + end + end + + _(spans.length).must_equal(2) + span = spans.find { |s| s.name == 'service_streaming_download.active_storage' } + + _(span).wont_be_nil + + _(span.attributes['active_storage.key']).must_equal(key_png) + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + end + + describe 'service_download_chunk.active_storage' do + describe 'with default configuration' do + it 'generates a service_download_chunk span' do + with_subscription do + return unless blob_png.respond_to?(:download_chunk) + + blob_png.download_chunk(0..1024) + end + + _(spans.length).must_equal(2) + span = spans.find { |s| s.name == 'service_download_chunk.active_storage' } + + _(span).wont_be_nil + + _(span.attributes['active_storage.key']).must_be_nil + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + + describe 'with custom configuration' do + it 'with key: :include' do + with_configuration(key: :include, disallowed_notification_payload_keys: []) do + with_subscription do + return unless blob_png.respond_to?(:download_chunk) + + blob_png.download_chunk(0..1024) + end + end + + _(spans.length).must_equal(2) + span = spans.find { |s| s.name == 'service_download_chunk.active_storage' } + + _(span).wont_be_nil + + _(span.attributes['active_storage.key']).must_equal(key_png) + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + end + + describe 'service_download.active_storage' do + describe 'with default configuration' do + it 'generates a service_download span' do + with_subscription do + _(blob_png.download).must_be(:present?) + end + + _(spans.length).must_equal(2) + span = spans.find { |s| s.name == 'service_download.active_storage' } + + _(span).wont_be_nil + + _(span.attributes['active_storage.key']).must_be_nil + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + + describe 'with custom configuration' do + it 'with key: :include' do + with_configuration(key: :include, disallowed_notification_payload_keys: []) do + with_subscription do + _(blob_png.download).must_be(:present?) + end + end + + _(spans.length).must_equal(2) + span = spans.find { |s| s.name == 'service_download.active_storage' } + + _(span).wont_be_nil + + _(span.attributes['active_storage.key']).must_equal(key_png) + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + end + + describe 'service_delete.active_storage' do + describe 'with default configuration' do + it 'generates a service_delete span' do + with_subscription do + blob_pdf.delete + end + + _(spans.length).must_equal(2) + span = spans.find { |s| s.name == 'service_delete.active_storage' } + + _(span).wont_be_nil + _(span.attributes['active_storage.key']).must_be_nil + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + + describe 'with custom configuration' do + it 'with key: :include' do + with_configuration(key: :include, disallowed_notification_payload_keys: []) do + with_subscription do + blob_pdf.delete + end + end + + _(spans.length).must_equal(2) + span = spans.find { |s| s.name == 'service_delete.active_storage' } + + _(span).wont_be_nil + _(span.attributes['active_storage.key']).must_equal(key_pdf) + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + end + + describe 'service_delete_prefixed.active_storage' do + it 'generates a service_delete_prefixed span' do + with_subscription do + ActiveStorage::Blob.service.delete_prefixed('sample') + end + + _(spans.length).must_equal(1) + span = spans.find { |s| s.name == 'service_delete_prefixed.active_storage' } + + _(span).wont_be_nil + + _(span.attributes['active_storage.prefix']).must_equal('sample') + _(span.attributes['active_storage.service']).must_equal('Disk') + end + end + + describe 'service_exist.active_storage' do + describe 'with default configuration' do + it 'generates a service_exist span' do + with_subscription do + _(ActiveStorage::Blob.service).wont_be(:exist?, 'key') + end + + _(spans.length).must_equal(1) + span = spans.find { |s| s.name == 'service_exist.active_storage' } + + _(span).wont_be_nil + _(span.attributes['active_storage.key']).must_be_nil + _(span.attributes['active_storage.service']).must_equal('Disk') + _(span.attributes['active_storage.exist']).must_equal(false) + end + end + + describe 'with custom configuration' do + it 'with key: :include' do + with_configuration(key: :include, disallowed_notification_payload_keys: []) do + with_subscription do + _(ActiveStorage::Blob.service).wont_be(:exist?, 'key') + end + end + + _(spans.length).must_equal(1) + span = spans.find { |s| s.name == 'service_exist.active_storage' } + + _(span).wont_be_nil + _(span.attributes['active_storage.key']).must_equal('key') + _(span.attributes['active_storage.service']).must_equal('Disk') + _(span.attributes['active_storage.exist']).must_equal(false) + end + end + end + + describe 'service_url.active_storage' do + describe 'with default configuration' do + it 'generates a service_url span' do + with_subscription do + _(blob_png.url).must_be(:present?) + end + + _(spans.length).must_equal(2) + span = spans.find { |s| s.name == 'service_url.active_storage' } + + _(span).wont_be_nil + _(span.attributes['active_storage.key']).must_be_nil + _(span.attributes['active_storage.service']).must_equal('Disk') + _(span.attributes['active_storage.url']).must_be_nil + end + end + + describe 'with custom configuration' do + it 'with key: :include' do + with_configuration(key: :include, url: :include, disallowed_notification_payload_keys: []) do + with_subscription do + _(blob_png.url).must_be(:present?) + end + end + + _(spans.length).must_equal(2) + span = spans.find { |s| s.name == 'service_url.active_storage' } + + _(span).wont_be_nil + _(span.attributes['active_storage.key']).must_equal(key_png) + _(span.attributes['active_storage.service']).must_equal('Disk') + _(span.attributes['active_storage.url']).must_match(%r{^http://example\.com/rails/active_storage/disk/.*/sample.png}) + end + end + end + + describe 'preview.active_storage' do + it 'generates a preview span' do + with_subscription do + _(blob_pdf.preview(resize_to_limit: [50, 50]).processed).must_be(:present?) + end + + _(spans.length >= 4).must_equal(true) + span = spans.find { |s| s.name == 'preview.active_storage' } + + _(span).wont_be_nil + end + end + + describe 'transform.active_storage' do + it 'generates a transform span' do + with_subscription do + _(blob_png.variant(resize_to_limit: [50, 50]).processed).must_be(:present?) + end + + _(spans.length).must_equal(5) + span = spans.find { |s| s.name == 'transform.active_storage' } + + _(span).wont_be_nil + end + end + + # NOTE: The test for service_update_metadata.active_storage is skipped because this event is only for GCS service. + # https://github.com/rails/rails/blob/fa9cf269191c5077de1abdd1e3f934fbeaf2a5d0/guides/source/active_support_instrumentation.md?plain=1#L928 + + def with_configuration(values, &block) + original_config = instrumentation.instance_variable_get(:@config) + modified_config = original_config.merge(values) + instrumentation.instance_variable_set(:@config, modified_config) + + yield + ensure + instrumentation.instance_variable_set(:@config, original_config) + end + + def with_subscription(&block) + OpenTelemetry::Instrumentation::ActiveStorage::Railtie.subscribe + yield + ensure + OpenTelemetry::Instrumentation::ActiveStorage::Railtie.unsubscribe + end +end diff --git a/instrumentation/active_storage/test/test_helper.rb b/instrumentation/active_storage/test/test_helper.rb new file mode 100644 index 000000000..47163b6de --- /dev/null +++ b/instrumentation/active_storage/test/test_helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +ENV['RAILS_ENV'] = 'test' + +require 'logger' +require 'bundler/setup' +Bundler.require(:default, :development, :test) + +require 'active_storage' +require 'minitest/autorun' +require 'test_helpers/app_config' + +# global opentelemetry-sdk setup: +EXPORTER = OpenTelemetry::SDK::Trace::Export::InMemorySpanExporter.new +span_processor = OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(EXPORTER) + +OpenTelemetry::SDK.configure do |c| + c.error_handler = ->(exception:, message:) { raise(exception || message) } + c.logger = Logger.new($stderr, level: ENV.fetch('OTEL_LOG_LEVEL', 'fatal').to_sym) + c.use 'OpenTelemetry::Instrumentation::ActiveStorage' + c.add_span_processor span_processor +end diff --git a/instrumentation/active_storage/test/test_helpers/app_config.rb b/instrumentation/active_storage/test/test_helpers/app_config.rb new file mode 100644 index 000000000..c9c5deb7b --- /dev/null +++ b/instrumentation/active_storage/test/test_helpers/app_config.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +require 'active_storage/engine' + +class TestApp < Rails::Application + initializer :activestorage do + ActiveStorage::Engine.config.active_storage.service_configurations = { + test: { + service: 'Disk', + root: Dir.mktmpdir('active_storage_tests') + } + } + end + + # Override to avoid reading config/database.yml + def config.database_configuration + { + test: { + adapter: 'sqlite3', + database: ':memory:' + } + } + end +end + +require_relative 'test_previewer' + +module AppConfig + extend self + + def initialize_app + new_app = TestApp.new + new_app.config.secret_key_base = 'secret_key_base' + + # Ensure we don't see this Rails warning when testing + new_app.config.eager_load = false + new_app.config.active_support.to_time_preserves_timezone = :zone + + # Prevent tests from creating log/*.log + level = ENV.fetch('OTEL_LOG_LEVEL', 'fatal').to_sym + new_app.config.logger = Logger.new($stderr, level: level) + new_app.config.log_level = level + + new_app.config.filter_parameters = [:param_to_be_filtered] + + new_app.config.hosts << 'example.org' + + new_app.config.active_storage.service = :test + new_app.config.active_storage.previewers = [TestPreviewer] + + # Unfreeze values which may have been frozen on previous initializations. + ActiveSupport::Dependencies.autoload_paths = + ActiveSupport::Dependencies.autoload_paths.dup + ActiveSupport::Dependencies.autoload_once_paths = + ActiveSupport::Dependencies.autoload_once_paths.dup + + new_app.initialize! + + ActiveRecord::Migration.verbose = false + ActiveRecord::Schema.define do + create_table :active_storage_blobs, force: true do |t| + t.string :key, null: false + t.string :filename, null: false + t.string :content_type + t.text :metadata + t.string :service_name, null: false + t.bigint :byte_size, null: false + t.string :checksum, null: false + t.datetime :created_at, null: false + t.index [:key], unique: true + end + + create_table :active_storage_attachments, force: true do |t| + t.string :name, null: false + t.references :record, null: false, polymorphic: true, index: false + t.references :blob, null: false + + t.datetime :created_at, null: false + t.index %i[record_type record_id name blob_id], name: 'index_active_storage_attachments_uniqueness', unique: true + end + end + + ActiveStorage::Current.url_options = { host: 'http://example.com' } + + if /^8\./.match?(Rails.version) + # Since Rails 8.0, route drawing has been deferred to the first request. + # See https://github.com/rails/rails/pull/52353 + # This forces route drawing to include ActiveStorage default routes. + new_app.reload_routes_unless_loaded + end + + new_app + end +end diff --git a/instrumentation/active_storage/test/test_helpers/test_previewer.rb b/instrumentation/active_storage/test/test_helpers/test_previewer.rb new file mode 100644 index 000000000..5097ce01d --- /dev/null +++ b/instrumentation/active_storage/test/test_helpers/test_previewer.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +# TestPreviewer does not require dependencies like MuPDF and Poppler, so when testing, you can replace +# config.active_storage.previewers with this class to test the preview hook with minimal dependencies. +class TestPreviewer < ActiveStorage::Previewer + def self.accept?(blob) + blob.content_type.start_with?('application/pdf') + end + + def preview(**options) + download_blob_to_tempfile do |input| + draw_sample_image input do |_output| + file = File.open("#{Dir.pwd}/test/fixtures/sample.png") + yield io: file, filename: 'sample.png', content_type: 'image/png', **options + end + end + end + + private + + def draw_sample_image(file, &block) + draw 'echo', '"test previewer called"', &block + end +end From 98edff1f29a1399ced79fbbd4450136e1c867377 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 09:24:17 -0600 Subject: [PATCH 08/20] release: Release opentelemetry-instrumentation-active_storage 0.1.0 (initial release) (#1374) * release: Release opentelemetry-instrumentation-active_storage 0.1.0 (initial release) * squash: Update instrumentation/active_storage/CHANGELOG.md --------- Co-authored-by: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Co-authored-by: Ariel Valentin --- instrumentation/active_storage/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/instrumentation/active_storage/CHANGELOG.md b/instrumentation/active_storage/CHANGELOG.md index 6e60ce45e..410d93c32 100644 --- a/instrumentation/active_storage/CHANGELOG.md +++ b/instrumentation/active_storage/CHANGELOG.md @@ -1 +1,5 @@ # Release History: opentelemetry-instrumentation-active_storage + +### v0.1.0 / 2025-01-29 + +Initial release! From d6568c1376735d0c4ee12998f424c9508911eb08 Mon Sep 17 00:00:00 2001 From: Zach Kemp Date: Wed, 29 Jan 2025 14:45:22 -0500 Subject: [PATCH 09/20] test: Fix simplecov configuration (#1366) test: start simplecov before library code is loaded Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> --- .github/actions/test_gem/action.yml | 18 ++++++++++++++++++ .github/workflows/ci-contrib.yml | 3 +++ .../ci-instrumentation-with-services.yml | 6 ++++++ .github/workflows/ci-instrumentation.yml | 3 ++- .simplecov | 14 ++++++++++++++ helpers/mysql/test/test_helper.rb | 1 + ...entelemetry-helpers-sql-obfuscation.gemspec | 1 + helpers/sql-obfuscation/test/test_helper.rb | 1 + .../action_mailer/test/test_helper.rb | 1 + .../action_pack/test/test_helper.rb | 1 + .../action_view/test/test_helper.rb | 1 + instrumentation/active_job/test/test_helper.rb | 1 + .../test/test_helper.rb | 1 + .../active_record/test/test_helper.rb | 1 + .../active_support/test/test_helper.rb | 1 + instrumentation/all/test/test_helper.rb | 1 + instrumentation/aws_lambda/test/test_helper.rb | 1 + instrumentation/aws_sdk/test/test_helper.rb | 1 + instrumentation/base/test/test_helper.rb | 4 +--- instrumentation/bunny/test/test_helper.rb | 1 + .../concurrent_ruby/test/test_helper.rb | 1 + instrumentation/dalli/test/test_helper.rb | 1 + .../delayed_job/test/test_helper.rb | 1 + instrumentation/ethon/test/test_helper.rb | 1 + instrumentation/excon/test/test_helper.rb | 1 + instrumentation/faraday/test/test_helper.rb | 1 + instrumentation/grape/test/test_helper.rb | 1 + instrumentation/graphql/test/test_helper.rb | 1 + instrumentation/grpc/test/test_helper.rb | 1 + instrumentation/gruf/test/test_helper.rb | 1 + instrumentation/http/test/test_helper.rb | 1 + .../http_client/test/test_helper.rb | 1 + instrumentation/httpx/test/test_helper.rb | 1 + instrumentation/koala/test/test_helper.rb | 1 + instrumentation/lmdb/test/test_helper.rb | 1 + instrumentation/mongo/test/test_helper.rb | 1 + instrumentation/mysql2/test/test_helper.rb | 1 + instrumentation/net_http/test/test_helper.rb | 1 + instrumentation/pg/test/test_helper.rb | 1 + instrumentation/que/test/test_helper.rb | 1 + instrumentation/racecar/test/test_helper.rb | 1 + instrumentation/rack/test/test_helper.rb | 1 + instrumentation/rails/Rakefile | 6 +++++- .../rails/test/instrumentation/test_helper.rb | 1 + .../rails/test/railtie/test_helper.rb | 4 ++-- instrumentation/rake/test/test_helper.rb | 1 + instrumentation/rdkafka/test/test_helper.rb | 1 + instrumentation/redis/test/test_helper.rb | 1 + instrumentation/resque/test/test_helper.rb | 1 + instrumentation/restclient/test/test_helper.rb | 1 + instrumentation/rspec/test/test_helper.rb | 3 ++- instrumentation/ruby_kafka/test/test_helper.rb | 1 + instrumentation/sidekiq/test/test_helper.rb | 1 + instrumentation/sinatra/test/test_helper.rb | 1 + instrumentation/trilogy/test/test_helper.rb | 1 + processor/baggage/Rakefile | 2 -- processor/baggage/test/test_helper.rb | 1 + propagator/ottrace/Rakefile | 2 -- propagator/ottrace/test/test_helper.rb | 7 +------ propagator/vitess/Rakefile | 2 -- propagator/vitess/test/test_helper.rb | 7 +------ propagator/xray/test/test_helper.rb | 1 + resources/azure/test/test_helper.rb | 4 +--- resources/container/test/test_helper.rb | 4 +--- .../google_cloud_platform/test/test_helper.rb | 4 +--- 65 files changed, 106 insertions(+), 35 deletions(-) create mode 100644 .simplecov diff --git a/.github/actions/test_gem/action.yml b/.github/actions/test_gem/action.yml index 05dbf4e02..0e438d335 100644 --- a/.github/actions/test_gem/action.yml +++ b/.github/actions/test_gem/action.yml @@ -19,6 +19,16 @@ inputs: required: false type: boolean default: false + coverage: + description: Enforce test coverage + required: false + type: boolean + default: false + minimum_coverage: + description: Minimum test coverage + required: false + type: string + default: 85 build: description: Build gem required: false @@ -161,6 +171,14 @@ runs: bundle exec rake rubocop working-directory: "${{ steps.setup.outputs.gem_dir }}" + - name: Coverage + shell: bash + if: "${{ inputs.coverage == 'true' }}" + # This starts a new simplecov run which tracks nothing of its own, + # but merges with the existing coverage reports generated during testing. + run: 'bundle exec ruby -e ''require "simplecov"; SimpleCov.minimum_coverage(${{ inputs.minimum_coverage }})''' + working-directory: "${{ steps.setup.outputs.gem_dir }}" + - name: Build Gem shell: bash if: "${{ inputs.build == 'true' }}" diff --git a/.github/workflows/ci-contrib.yml b/.github/workflows/ci-contrib.yml index d62ff1423..5745a8c7c 100644 --- a/.github/workflows/ci-contrib.yml +++ b/.github/workflows/ci-contrib.yml @@ -47,6 +47,7 @@ jobs: ruby: "3.1" yard: true rubocop: true + coverage: true build: true - name: "Test JRuby" if: "${{ matrix.os == 'ubuntu-latest' }}" @@ -125,6 +126,7 @@ jobs: ruby: "3.1" yard: true rubocop: true + coverage: true build: true - name: "Test JRuby" if: "${{ matrix.os == 'ubuntu-latest' }}" @@ -162,6 +164,7 @@ jobs: ruby: "3.1" yard: true rubocop: true + coverage: true build: true - name: "Test JRuby" if: "${{ matrix.os == 'ubuntu-latest' && steps.jruby_skip.outputs.skip == 'false' }}" diff --git a/.github/workflows/ci-instrumentation-with-services.yml b/.github/workflows/ci-instrumentation-with-services.yml index d92a23122..7b8d0873c 100644 --- a/.github/workflows/ci-instrumentation-with-services.yml +++ b/.github/workflows/ci-instrumentation-with-services.yml @@ -46,6 +46,7 @@ jobs: ruby: "3.1" yard: true rubocop: true + coverage: true build: true - name: "Test JRuby" uses: ./.github/actions/test_gem @@ -92,6 +93,7 @@ jobs: ruby: "3.1" yard: true rubocop: true + coverage: true build: true services: mysql: @@ -129,6 +131,7 @@ jobs: ruby: "3.1" yard: true rubocop: true + coverage: true build: true services: zookeeper: @@ -182,6 +185,7 @@ jobs: ruby: "3.1" yard: true rubocop: true + coverage: true build: true services: redis: @@ -226,6 +230,7 @@ jobs: ruby: "3.1" yard: true rubocop: true + coverage: true build: true services: postgres: @@ -267,6 +272,7 @@ jobs: ruby: "3.1" yard: true rubocop: true + coverage: true build: true services: rabbitmq: diff --git a/.github/workflows/ci-instrumentation.yml b/.github/workflows/ci-instrumentation.yml index 31ffe8c65..8fcfdf590 100644 --- a/.github/workflows/ci-instrumentation.yml +++ b/.github/workflows/ci-instrumentation.yml @@ -73,10 +73,11 @@ jobs: - name: "Test Ruby 3.1" uses: ./.github/actions/test_gem with: - gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" ruby: "3.1" yard: true rubocop: true + coverage: true build: true - name: "JRuby Filter" id: jruby_skip diff --git a/.simplecov b/.simplecov new file mode 100644 index 000000000..150d753f2 --- /dev/null +++ b/.simplecov @@ -0,0 +1,14 @@ +require 'digest' + +digest = Digest::MD5.new +digest.update('test') +digest.update(ENV.fetch('BUNDLE_GEMFILE', 'gemfile')) if ENV['APPRAISAL_INITIALIZED'] + +ENV['ENABLE_COVERAGE'] ||= '1' + +if ENV['ENABLE_COVERAGE'].to_i.positive? + SimpleCov.command_name(digest.hexdigest) + SimpleCov.start do + add_filter %r{^/test/} + end +end diff --git a/helpers/mysql/test/test_helper.rb b/helpers/mysql/test/test_helper.rb index 0f824f6b8..641f06867 100644 --- a/helpers/mysql/test/test_helper.rb +++ b/helpers/mysql/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec b/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec index 4c6a73b76..a8159ad8f 100644 --- a/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec +++ b/helpers/sql-obfuscation/opentelemetry-helpers-sql-obfuscation.gemspec @@ -33,6 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' spec.add_development_dependency 'yard-doctest', '~> 0.1.6' diff --git a/helpers/sql-obfuscation/test/test_helper.rb b/helpers/sql-obfuscation/test/test_helper.rb index 6e84b456c..2f81f2c99 100644 --- a/helpers/sql-obfuscation/test/test_helper.rb +++ b/helpers/sql-obfuscation/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/action_mailer/test/test_helper.rb b/instrumentation/action_mailer/test/test_helper.rb index bd915555e..3c15da177 100644 --- a/instrumentation/action_mailer/test/test_helper.rb +++ b/instrumentation/action_mailer/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'logger' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/action_pack/test/test_helper.rb b/instrumentation/action_pack/test/test_helper.rb index 9594f934f..992871d77 100644 --- a/instrumentation/action_pack/test/test_helper.rb +++ b/instrumentation/action_pack/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'logger' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/action_view/test/test_helper.rb b/instrumentation/action_view/test/test_helper.rb index e3eafdddb..f2ff8566d 100644 --- a/instrumentation/action_view/test/test_helper.rb +++ b/instrumentation/action_view/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'logger' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/active_job/test/test_helper.rb b/instrumentation/active_job/test/test_helper.rb index dd134b0ff..938cb3bdd 100644 --- a/instrumentation/active_job/test/test_helper.rb +++ b/instrumentation/active_job/test/test_helper.rb @@ -5,6 +5,7 @@ # SPDX-License-Identifier: Apache-2.0 ENV['OTEL_LOG_LEVEL'] ||= 'fatal' +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/active_model_serializers/test/test_helper.rb b/instrumentation/active_model_serializers/test/test_helper.rb index f5e69ad52..1bbc33d03 100644 --- a/instrumentation/active_model_serializers/test/test_helper.rb +++ b/instrumentation/active_model_serializers/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/active_record/test/test_helper.rb b/instrumentation/active_record/test/test_helper.rb index 02751e7f6..3138f52d8 100644 --- a/instrumentation/active_record/test/test_helper.rb +++ b/instrumentation/active_record/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/active_support/test/test_helper.rb b/instrumentation/active_support/test/test_helper.rb index 2c5c5cce2..f0f85f3dc 100644 --- a/instrumentation/active_support/test/test_helper.rb +++ b/instrumentation/active_support/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/all/test/test_helper.rb b/instrumentation/all/test/test_helper.rb index 026a026a2..29b15e305 100644 --- a/instrumentation/all/test/test_helper.rb +++ b/instrumentation/all/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/aws_lambda/test/test_helper.rb b/instrumentation/aws_lambda/test/test_helper.rb index cf3cde320..3a265d369 100644 --- a/instrumentation/aws_lambda/test/test_helper.rb +++ b/instrumentation/aws_lambda/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/aws_sdk/test/test_helper.rb b/instrumentation/aws_sdk/test/test_helper.rb index b588f8c75..c8a505356 100644 --- a/instrumentation/aws_sdk/test/test_helper.rb +++ b/instrumentation/aws_sdk/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/base/test/test_helper.rb b/instrumentation/base/test/test_helper.rb index 9efdc59b3..6e20a575a 100644 --- a/instrumentation/base/test/test_helper.rb +++ b/instrumentation/base/test/test_helper.rb @@ -4,12 +4,10 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) -SimpleCov.start -SimpleCov.minimum_coverage 85 - require 'opentelemetry-instrumentation-base' require 'minitest/autorun' diff --git a/instrumentation/bunny/test/test_helper.rb b/instrumentation/bunny/test/test_helper.rb index 0c2839200..c1d6ca245 100644 --- a/instrumentation/bunny/test/test_helper.rb +++ b/instrumentation/bunny/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/concurrent_ruby/test/test_helper.rb b/instrumentation/concurrent_ruby/test/test_helper.rb index 59f69b7de..b4f7067b6 100644 --- a/instrumentation/concurrent_ruby/test/test_helper.rb +++ b/instrumentation/concurrent_ruby/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/dalli/test/test_helper.rb b/instrumentation/dalli/test/test_helper.rb index 64fd974d4..326f2aa13 100644 --- a/instrumentation/dalli/test/test_helper.rb +++ b/instrumentation/dalli/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/delayed_job/test/test_helper.rb b/instrumentation/delayed_job/test/test_helper.rb index b91ed8185..96af0c334 100644 --- a/instrumentation/delayed_job/test/test_helper.rb +++ b/instrumentation/delayed_job/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'logger' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/ethon/test/test_helper.rb b/instrumentation/ethon/test/test_helper.rb index 64fd974d4..326f2aa13 100644 --- a/instrumentation/ethon/test/test_helper.rb +++ b/instrumentation/ethon/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/excon/test/test_helper.rb b/instrumentation/excon/test/test_helper.rb index aa05118d1..eb5359518 100644 --- a/instrumentation/excon/test/test_helper.rb +++ b/instrumentation/excon/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/faraday/test/test_helper.rb b/instrumentation/faraday/test/test_helper.rb index 040b6a155..49b3ed979 100644 --- a/instrumentation/faraday/test/test_helper.rb +++ b/instrumentation/faraday/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/grape/test/test_helper.rb b/instrumentation/grape/test/test_helper.rb index 7b12c181c..759aa83a7 100644 --- a/instrumentation/grape/test/test_helper.rb +++ b/instrumentation/grape/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/graphql/test/test_helper.rb b/instrumentation/graphql/test/test_helper.rb index 7129b1408..6a64fad62 100644 --- a/instrumentation/graphql/test/test_helper.rb +++ b/instrumentation/graphql/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/grpc/test/test_helper.rb b/instrumentation/grpc/test/test_helper.rb index 19330e92a..1418bf7ca 100644 --- a/instrumentation/grpc/test/test_helper.rb +++ b/instrumentation/grpc/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/gruf/test/test_helper.rb b/instrumentation/gruf/test/test_helper.rb index 59a31967d..3e8f5dc14 100644 --- a/instrumentation/gruf/test/test_helper.rb +++ b/instrumentation/gruf/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'opentelemetry/sdk' require 'minitest/autorun' require 'webmock/minitest' diff --git a/instrumentation/http/test/test_helper.rb b/instrumentation/http/test/test_helper.rb index f2155e1df..7ff213131 100644 --- a/instrumentation/http/test/test_helper.rb +++ b/instrumentation/http/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/http_client/test/test_helper.rb b/instrumentation/http_client/test/test_helper.rb index aa05118d1..eb5359518 100644 --- a/instrumentation/http_client/test/test_helper.rb +++ b/instrumentation/http_client/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/httpx/test/test_helper.rb b/instrumentation/httpx/test/test_helper.rb index 10c09f2da..4768b0ea4 100644 --- a/instrumentation/httpx/test/test_helper.rb +++ b/instrumentation/httpx/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/koala/test/test_helper.rb b/instrumentation/koala/test/test_helper.rb index 07022ca9a..524986945 100644 --- a/instrumentation/koala/test/test_helper.rb +++ b/instrumentation/koala/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/lmdb/test/test_helper.rb b/instrumentation/lmdb/test/test_helper.rb index aa05118d1..eb5359518 100644 --- a/instrumentation/lmdb/test/test_helper.rb +++ b/instrumentation/lmdb/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/mongo/test/test_helper.rb b/instrumentation/mongo/test/test_helper.rb index 418c41ef6..4c67e3866 100644 --- a/instrumentation/mongo/test/test_helper.rb +++ b/instrumentation/mongo/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/mysql2/test/test_helper.rb b/instrumentation/mysql2/test/test_helper.rb index 64fd974d4..326f2aa13 100644 --- a/instrumentation/mysql2/test/test_helper.rb +++ b/instrumentation/mysql2/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/net_http/test/test_helper.rb b/instrumentation/net_http/test/test_helper.rb index 921a7e11c..82b97ec0e 100644 --- a/instrumentation/net_http/test/test_helper.rb +++ b/instrumentation/net_http/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'net/http' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/pg/test/test_helper.rb b/instrumentation/pg/test/test_helper.rb index 55c179cd9..a8e6ed746 100644 --- a/instrumentation/pg/test/test_helper.rb +++ b/instrumentation/pg/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/que/test/test_helper.rb b/instrumentation/que/test/test_helper.rb index 27414d2f3..d60cb56dc 100644 --- a/instrumentation/que/test/test_helper.rb +++ b/instrumentation/que/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/racecar/test/test_helper.rb b/instrumentation/racecar/test/test_helper.rb index e7695dc18..08e78bbef 100644 --- a/instrumentation/racecar/test/test_helper.rb +++ b/instrumentation/racecar/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/rack/test/test_helper.rb b/instrumentation/rack/test/test_helper.rb index 111b03057..08824e318 100644 --- a/instrumentation/rack/test/test_helper.rb +++ b/instrumentation/rack/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) require 'rack/events' diff --git a/instrumentation/rails/Rakefile b/instrumentation/rails/Rakefile index 14260497c..d580aaf5c 100644 --- a/instrumentation/rails/Rakefile +++ b/instrumentation/rails/Rakefile @@ -23,10 +23,14 @@ namespace :test do t.libs << 'test/railtie' t.test_files = FileList['test/railtie/**/*_test.rb'] end + + task :start_coverage do + require 'simplecov' + end end desc 'Run all tests' -task test: %i[test:instrumentation test:railtie] +task test: %i[test:start_coverage test:instrumentation test:railtie] YARD::Rake::YardocTask.new do |t| t.stats_options = ['--list-undoc'] diff --git a/instrumentation/rails/test/instrumentation/test_helper.rb b/instrumentation/rails/test/instrumentation/test_helper.rb index 73d2cf657..23b54a7be 100644 --- a/instrumentation/rails/test/instrumentation/test_helper.rb +++ b/instrumentation/rails/test/instrumentation/test_helper.rb @@ -5,6 +5,7 @@ # SPDX-License-Identifier: Apache-2.0 require 'logger' +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/rails/test/railtie/test_helper.rb b/instrumentation/rails/test/railtie/test_helper.rb index c2aeff8b7..47fc82f4e 100644 --- a/instrumentation/rails/test/railtie/test_helper.rb +++ b/instrumentation/rails/test/railtie/test_helper.rb @@ -9,10 +9,10 @@ ENV['RAILS_ENV'] = 'test' require 'logger' +require 'simplecov' + require 'bundler/setup' Bundler.require(:default, :development, :test) require_relative '../../test/railtie/dummy/config/environment' require 'rails/test_help' - -SimpleCov.start diff --git a/instrumentation/rake/test/test_helper.rb b/instrumentation/rake/test/test_helper.rb index aa05118d1..eb5359518 100644 --- a/instrumentation/rake/test/test_helper.rb +++ b/instrumentation/rake/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/rdkafka/test/test_helper.rb b/instrumentation/rdkafka/test/test_helper.rb index aa05118d1..eb5359518 100644 --- a/instrumentation/rdkafka/test/test_helper.rb +++ b/instrumentation/rdkafka/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/redis/test/test_helper.rb b/instrumentation/redis/test/test_helper.rb index 9375d9e5e..c04d0aff7 100644 --- a/instrumentation/redis/test/test_helper.rb +++ b/instrumentation/redis/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/resque/test/test_helper.rb b/instrumentation/resque/test/test_helper.rb index a8011b8d0..6aa9779ad 100644 --- a/instrumentation/resque/test/test_helper.rb +++ b/instrumentation/resque/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/restclient/test/test_helper.rb b/instrumentation/restclient/test/test_helper.rb index aa05118d1..eb5359518 100644 --- a/instrumentation/restclient/test/test_helper.rb +++ b/instrumentation/restclient/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/rspec/test/test_helper.rb b/instrumentation/rspec/test/test_helper.rb index 6f810ffc5..ab5075bbe 100644 --- a/instrumentation/rspec/test/test_helper.rb +++ b/instrumentation/rspec/test/test_helper.rb @@ -4,7 +4,8 @@ # # SPDX-License-Identifier: Apache-2.0 -# This gem does not use Bundler to require gems because it is testing confilicting features between rspec and minitest. +# This gem does not use Bundler to require gems because it is testing conflicting features between rspec and minitest. +require 'simplecov' require 'opentelemetry/sdk' require 'opentelemetry-test-helpers' diff --git a/instrumentation/ruby_kafka/test/test_helper.rb b/instrumentation/ruby_kafka/test/test_helper.rb index efc2863df..e1bfab332 100644 --- a/instrumentation/ruby_kafka/test/test_helper.rb +++ b/instrumentation/ruby_kafka/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/sidekiq/test/test_helper.rb b/instrumentation/sidekiq/test/test_helper.rb index df49e4125..b7e37cd68 100644 --- a/instrumentation/sidekiq/test/test_helper.rb +++ b/instrumentation/sidekiq/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/sinatra/test/test_helper.rb b/instrumentation/sinatra/test/test_helper.rb index 48ae2a681..897d8e032 100644 --- a/instrumentation/sinatra/test/test_helper.rb +++ b/instrumentation/sinatra/test/test_helper.rb @@ -5,6 +5,7 @@ # SPDX-License-Identifier: Apache-2.0 ENV['APP_ENV'] = 'test' +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/instrumentation/trilogy/test/test_helper.rb b/instrumentation/trilogy/test/test_helper.rb index aba8e1527..b4e1fb233 100644 --- a/instrumentation/trilogy/test/test_helper.rb +++ b/instrumentation/trilogy/test/test_helper.rb @@ -6,6 +6,7 @@ ENV['OTEL_LOG_LEVEL'] ||= 'fatal' +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/processor/baggage/Rakefile b/processor/baggage/Rakefile index 88f3670a3..1a64ba842 100644 --- a/processor/baggage/Rakefile +++ b/processor/baggage/Rakefile @@ -9,8 +9,6 @@ require 'rake/testtask' require 'yard' require 'rubocop/rake_task' -ENV['ENABLE_COVERAGE'] ||= '1' - RuboCop::RakeTask.new Rake::TestTask.new :test do |t| diff --git a/processor/baggage/test/test_helper.rb b/processor/baggage/test/test_helper.rb index 8c1eb5932..17115057e 100644 --- a/processor/baggage/test/test_helper.rb +++ b/processor/baggage/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/propagator/ottrace/Rakefile b/propagator/ottrace/Rakefile index 88f3670a3..1a64ba842 100644 --- a/propagator/ottrace/Rakefile +++ b/propagator/ottrace/Rakefile @@ -9,8 +9,6 @@ require 'rake/testtask' require 'yard' require 'rubocop/rake_task' -ENV['ENABLE_COVERAGE'] ||= '1' - RuboCop::RakeTask.new Rake::TestTask.new :test do |t| diff --git a/propagator/ottrace/test/test_helper.rb b/propagator/ottrace/test/test_helper.rb index ea0b34f14..d54638882 100644 --- a/propagator/ottrace/test/test_helper.rb +++ b/propagator/ottrace/test/test_helper.rb @@ -4,16 +4,11 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) require 'opentelemetry-propagator-ottrace' require 'minitest/autorun' -if ENV['ENABLE_COVERAGE'].to_i.positive? - require 'simplecov' - SimpleCov.start - SimpleCov.minimum_coverage 85 -end - OpenTelemetry.logger = Logger.new($stderr, level: ENV.fetch('OTEL_LOG_LEVEL', 'fatal').to_sym) diff --git a/propagator/vitess/Rakefile b/propagator/vitess/Rakefile index 88f3670a3..1a64ba842 100644 --- a/propagator/vitess/Rakefile +++ b/propagator/vitess/Rakefile @@ -9,8 +9,6 @@ require 'rake/testtask' require 'yard' require 'rubocop/rake_task' -ENV['ENABLE_COVERAGE'] ||= '1' - RuboCop::RakeTask.new Rake::TestTask.new :test do |t| diff --git a/propagator/vitess/test/test_helper.rb b/propagator/vitess/test/test_helper.rb index 681e85d48..02470847b 100644 --- a/propagator/vitess/test/test_helper.rb +++ b/propagator/vitess/test/test_helper.rb @@ -4,16 +4,11 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) require 'opentelemetry-propagator-vitess' require 'minitest/autorun' -if ENV['ENABLE_COVERAGE'].to_i.positive? - require 'simplecov' - SimpleCov.start - SimpleCov.minimum_coverage 85 -end - OpenTelemetry.logger = Logger.new($stderr, level: ENV.fetch('OTEL_LOG_LEVEL', 'fatal').to_sym) diff --git a/propagator/xray/test/test_helper.rb b/propagator/xray/test/test_helper.rb index 656cf5edd..9ccfc1e09 100644 --- a/propagator/xray/test/test_helper.rb +++ b/propagator/xray/test/test_helper.rb @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) diff --git a/resources/azure/test/test_helper.rb b/resources/azure/test/test_helper.rb index 3727952a1..e8b1a8db7 100644 --- a/resources/azure/test/test_helper.rb +++ b/resources/azure/test/test_helper.rb @@ -4,12 +4,10 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) -SimpleCov.minimum_coverage 85 -SimpleCov.start - require 'opentelemetry-resource-detector-azure' require 'minitest/autorun' require 'webmock/minitest' diff --git a/resources/container/test/test_helper.rb b/resources/container/test/test_helper.rb index 1937b514a..1c8ae39b6 100644 --- a/resources/container/test/test_helper.rb +++ b/resources/container/test/test_helper.rb @@ -4,12 +4,10 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) -SimpleCov.minimum_coverage 85 -SimpleCov.start - require 'opentelemetry-resource-detector-container' require 'minitest/autorun' diff --git a/resources/google_cloud_platform/test/test_helper.rb b/resources/google_cloud_platform/test/test_helper.rb index ed27a8743..7d1981147 100644 --- a/resources/google_cloud_platform/test/test_helper.rb +++ b/resources/google_cloud_platform/test/test_helper.rb @@ -4,12 +4,10 @@ # # SPDX-License-Identifier: Apache-2.0 +require 'simplecov' require 'bundler/setup' Bundler.require(:default, :development, :test) -SimpleCov.minimum_coverage 85 -SimpleCov.start - require 'opentelemetry-resource-detector-google_cloud_platform' require 'minitest/autorun' require 'webmock/minitest' From e1e1cc4c8579a43ac5cf138d5b79da461657e71b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 11:58:54 -0800 Subject: [PATCH 10/20] chore: bump ruby/setup-ruby from 1.213.0 to 1.214.0 (#1371) * chore: bump ruby/setup-ruby from 1.213.0 to 1.214.0 Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.213.0 to 1.214.0. - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/v1.213.0...v1.214.0) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore: bump ruby/setup-ruby to 1.214.0; bump jruby Increase JRuby testing from 9.4.9.0 to 9.4.10.0. --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kayla Reopelle Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> --- .github/actions/test_gem/action.yml | 4 ++-- .github/workflows/ci-contrib.yml | 8 ++++---- .github/workflows/ci-instrumentation-with-services.yml | 2 +- .github/workflows/ci-instrumentation.yml | 2 +- .github/workflows/installation-tests.yml | 2 +- .github/workflows/release-hook-on-closed.yml | 2 +- .github/workflows/release-hook-on-push.yml | 2 +- .github/workflows/release-perform.yml | 2 +- .github/workflows/release-please.yaml | 2 +- .github/workflows/release-request-weekly.yml | 2 +- .github/workflows/release-request.yml | 2 +- .github/workflows/release-retry.yml | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/actions/test_gem/action.yml b/.github/actions/test_gem/action.yml index 0e438d335..276452354 100644 --- a/.github/actions/test_gem/action.yml +++ b/.github/actions/test_gem/action.yml @@ -84,7 +84,7 @@ runs: # ...but not for appraisals, sadly. - name: Install Ruby ${{ inputs.ruby }} with dependencies if: "${{ steps.setup.outputs.appraisals == 'false' }}" - uses: ruby/setup-ruby@v1.213.0 + uses: ruby/setup-ruby@v1.214.0 with: ruby-version: "${{ inputs.ruby }}" working-directory: "${{ steps.setup.outputs.gem_dir }}" @@ -95,7 +95,7 @@ runs: # If we're using appraisals, do it all manually. - name: Install Ruby ${{ inputs.ruby }} without dependencies if: "${{ steps.setup.outputs.appraisals == 'true' }}" - uses: ruby/setup-ruby@v1.213.0 + uses: ruby/setup-ruby@v1.214.0 with: ruby-version: "${{ inputs.ruby }}" bundler: "latest" diff --git a/.github/workflows/ci-contrib.yml b/.github/workflows/ci-contrib.yml index 5745a8c7c..1f0d0c65a 100644 --- a/.github/workflows/ci-contrib.yml +++ b/.github/workflows/ci-contrib.yml @@ -54,7 +54,7 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-helpers-${{ matrix.gem }}" - ruby: "jruby-9.4.9.0" + ruby: "jruby-9.4.10.0" propagators: strategy: @@ -93,7 +93,7 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-propagator-${{ matrix.gem }}" - ruby: "jruby-9.4.9.0" + ruby: "jruby-9.4.10.0" resource-detectors: strategy: @@ -133,7 +133,7 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-${{ matrix.gem }}" - ruby: "jruby-9.4.9.0" + ruby: "jruby-9.4.10.0" processors: strategy: @@ -171,4 +171,4 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-processor-${{ matrix.gem }}" - ruby: "jruby-9.4.9.0" + ruby: "jruby-9.4.10.0" diff --git a/.github/workflows/ci-instrumentation-with-services.yml b/.github/workflows/ci-instrumentation-with-services.yml index 7b8d0873c..e30123ae7 100644 --- a/.github/workflows/ci-instrumentation-with-services.yml +++ b/.github/workflows/ci-instrumentation-with-services.yml @@ -52,7 +52,7 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "jruby-9.4.9.0" + ruby: "jruby-9.4.10.0" services: memcached: image: memcached:alpine diff --git a/.github/workflows/ci-instrumentation.yml b/.github/workflows/ci-instrumentation.yml index 8fcfdf590..491fd6e32 100644 --- a/.github/workflows/ci-instrumentation.yml +++ b/.github/workflows/ci-instrumentation.yml @@ -109,4 +109,4 @@ jobs: uses: ./.github/actions/test_gem with: gem: "opentelemetry-instrumentation-${{ matrix.gem }}" - ruby: "jruby-9.4.9.0" + ruby: "jruby-9.4.10.0" diff --git a/.github/workflows/installation-tests.yml b/.github/workflows/installation-tests.yml index 95ec6cb20..12a0a1448 100644 --- a/.github/workflows/installation-tests.yml +++ b/.github/workflows/installation-tests.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v4 # ATTENTION: Dependabot does not know how to update shared actions file. # If you see it update setup-ruby here also update it as part of actions/test_gem/action.yml - - uses: ruby/setup-ruby@v1.213.0 + - uses: ruby/setup-ruby@v1.214.0 with: ruby-version: ${{ matrix.ruby-version }} - name: "Install Latest Gem Versions on ${{ matrix.ruby-version }}" diff --git a/.github/workflows/release-hook-on-closed.yml b/.github/workflows/release-hook-on-closed.yml index 4f7556f56..d9979bb2c 100644 --- a/.github/workflows/release-hook-on-closed.yml +++ b/.github/workflows/release-hook-on-closed.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.213.0 + uses: ruby/setup-ruby@v1.214.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-hook-on-push.yml b/.github/workflows/release-hook-on-push.yml index ba0e200a5..07ba1e07d 100644 --- a/.github/workflows/release-hook-on-push.yml +++ b/.github/workflows/release-hook-on-push.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.213.0 + uses: ruby/setup-ruby@v1.214.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-perform.yml b/.github/workflows/release-perform.yml index a3d3e0a5a..d158477f3 100644 --- a/.github/workflows/release-perform.yml +++ b/.github/workflows/release-perform.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.213.0 + uses: ruby/setup-ruby@v1.214.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 2391aa70d..49f610cd3 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -50,7 +50,7 @@ jobs: chmod 0600 $HOME/.gem/credentials printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - - uses: ruby/setup-ruby@v1.213.0 + - uses: ruby/setup-ruby@v1.214.0 with: ruby-version: "3.1" bundler: latest diff --git a/.github/workflows/release-request-weekly.yml b/.github/workflows/release-request-weekly.yml index 586b2c5eb..47140b6f5 100644 --- a/.github/workflows/release-request-weekly.yml +++ b/.github/workflows/release-request-weekly.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.213.0 + uses: ruby/setup-ruby@v1.214.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-request.yml b/.github/workflows/release-request.yml index d822f8a10..89c5a6fc5 100644 --- a/.github/workflows/release-request.yml +++ b/.github/workflows/release-request.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.213.0 + uses: ruby/setup-ruby@v1.214.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-retry.yml b/.github/workflows/release-retry.yml index b537f0808..3f403396c 100644 --- a/.github/workflows/release-retry.yml +++ b/.github/workflows/release-retry.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.213.0 + uses: ruby/setup-ruby@v1.214.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo From fb9cdf42d6f14736b630a974d0fab878a4f66145 Mon Sep 17 00:00:00 2001 From: Josh Westbrook Date: Wed, 29 Jan 2025 14:05:53 -0600 Subject: [PATCH 11/20] feat: AWS lambda programatic wrap (#1308) * feat: Support programatically wrapping lambda handlers * chore: Update README and conditionally flush metrics * fix: No ruby 3.1 shorthand * fix: typo and module length * Add tests for instrument_handler * fix: Trailing whitespace --------- Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> --- instrumentation/aws_lambda/README.md | 26 +++ .../instrumentation/aws_lambda/handler.rb | 135 +------------- .../aws_lambda/instrumentation.rb | 1 + .../instrumentation/aws_lambda/wrap.rb | 171 ++++++++++++++++++ .../opentelemetry/instrumentation_test.rb | 94 ++++++++++ 5 files changed, 296 insertions(+), 131 deletions(-) create mode 100644 instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/wrap.rb diff --git a/instrumentation/aws_lambda/README.md b/instrumentation/aws_lambda/README.md index 3dc9bff1b..d69280eaf 100644 --- a/instrumentation/aws_lambda/README.md +++ b/instrumentation/aws_lambda/README.md @@ -28,6 +28,32 @@ def otel_wrapper(event:, context:) end ``` +### Alternative Usage + +If using a Lambda Layer is not an option for your given setup, you can programmatically instrument a handler by using the `OpenTelemetry::Instrumentation::AwsLambda::Wrap` module. + +```ruby +require 'opentelemetry/sdk' +require 'opentelemetry/instrumentation/aws_lambda' + +OpenTelemetry::SDK.configure do |c| + c.service_name = '' + c.use 'OpenTelemetry::Instrumentation::AwsLambda' +end + +# Lambda Handler +module Example + class Handler + extend OpenTelemetry::Instrumentation::AwsLambda::Wrap + + def self.process(event:, context:) + puts event.inspect + end + instrument_handler :process + end +end +``` + ## Example To run the example: diff --git a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/handler.rb b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/handler.rb index fa0f55de2..728505474 100644 --- a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/handler.rb +++ b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/handler.rb @@ -7,10 +7,10 @@ module OpenTelemetry module Instrumentation module AwsLambda - AWS_TRIGGERS = ['aws:sqs', 'aws:s3', 'aws:sns', 'aws:dynamodb'].freeze - # Handler class that creates a span around the _HANDLER class Handler + extend OpenTelemetry::Instrumentation::AwsLambda::Wrap + attr_reader :handler_method, :handler_class # anytime when the code in a Lambda function is updated or the functional configuration is changed, @@ -28,47 +28,9 @@ def initialize # Try to record and re-raise any exception from the wrapped function handler # Instrumentation should never raise its own exception def call_wrapped(event:, context:) - parent_context = extract_parent_context(event) - - span_kind = if event['Records'] && AWS_TRIGGERS.include?(event['Records'].dig(0, 'eventSource')) - :consumer - else - :server - end - - original_handler_error = nil - original_response = nil - OpenTelemetry::Context.with_current(parent_context) do - tracer.in_span(@original_handler, attributes: otel_attributes(event, context), kind: span_kind) do |span| - begin - response = call_original_handler(event: event, context: context) - status_code = response['statusCode'] || response[:statusCode] if response.is_a?(Hash) - span.set_attribute(OpenTelemetry::SemanticConventions::Trace::HTTP_STATUS_CODE, status_code) if status_code - rescue StandardError => e - original_handler_error = e - ensure - original_response = response - end - if original_handler_error - span.record_exception(original_handler_error) - span.status = OpenTelemetry::Trace::Status.error(original_handler_error.message) - end - end + self.class.wrap_lambda(event: event, context: context, handler: @original_handler, flush_timeout: @flush_timeout) do + call_original_handler(event: event, context: context) end - - OpenTelemetry.tracer_provider.force_flush(timeout: @flush_timeout) - - raise original_handler_error if original_handler_error - - original_response - end - - def instrumentation_config - AwsLambda::Instrumentation.instance.config - end - - def tracer - AwsLambda::Instrumentation.instance.tracer end private @@ -94,95 +56,6 @@ def call_original_handler(event:, context:) __send__(@handler_method, event: event, context: context) end end - - # Extract parent context from request headers - # Downcase Traceparent and Tracestate because TraceContext::TextMapPropagator's TRACEPARENT_KEY and TRACESTATE_KEY are all lowercase - # If any error occur, rescue and give empty context - def extract_parent_context(event) - headers = event['headers'] || {} - headers.transform_keys! do |key| - %w[Traceparent Tracestate].include?(key) ? key.downcase : key - end - - OpenTelemetry.propagation.extract( - headers, - getter: OpenTelemetry::Context::Propagation.text_map_getter - ) - rescue StandardError => e - OpenTelemetry.logger.error("aws-lambda instrumentation exception occurred while extracting the parent context: #{e.message}") - OpenTelemetry::Context.empty - end - - # lambda event version 1.0 and version 2.0 - # https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html - def v1_proxy_attributes(event) - attributes = { - OpenTelemetry::SemanticConventions::Trace::HTTP_METHOD => event['httpMethod'], - OpenTelemetry::SemanticConventions::Trace::HTTP_ROUTE => event['resource'], - OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET => event['resource'] - } - attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET] += "?#{event['queryStringParameters']}" if event['queryStringParameters'] - - headers = event['headers'] - if headers - attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_USER_AGENT] = headers['User-Agent'] - attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_SCHEME] = headers['X-Forwarded-Proto'] - attributes[OpenTelemetry::SemanticConventions::Trace::NET_HOST_NAME] = headers['Host'] - end - attributes - end - - def v2_proxy_attributes(event) - request_context = event['requestContext'] - attributes = { - OpenTelemetry::SemanticConventions::Trace::NET_HOST_NAME => request_context['domainName'], - OpenTelemetry::SemanticConventions::Trace::HTTP_METHOD => request_context['http']['method'], - OpenTelemetry::SemanticConventions::Trace::HTTP_USER_AGENT => request_context['http']['userAgent'], - OpenTelemetry::SemanticConventions::Trace::HTTP_ROUTE => request_context['http']['path'], - OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET => request_context['http']['path'] - } - attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET] += "?#{event['rawQueryString']}" if event['rawQueryString'] - attributes - end - - # fass.trigger set to http: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md#api-gateway - # TODO: need to update Semantic Conventions for invocation_id, trigger and resource_id - def otel_attributes(event, context) - span_attributes = {} - span_attributes['faas.invocation_id'] = context.aws_request_id - span_attributes['cloud.resource_id'] = context.invoked_function_arn - span_attributes[OpenTelemetry::SemanticConventions::Trace::AWS_LAMBDA_INVOKED_ARN] = context.invoked_function_arn - span_attributes[OpenTelemetry::SemanticConventions::Resource::CLOUD_ACCOUNT_ID] = context.invoked_function_arn.split(':')[4] - - if event['requestContext'] - request_attributes = event['version'] == '2.0' ? v2_proxy_attributes(event) : v1_proxy_attributes(event) - request_attributes[OpenTelemetry::SemanticConventions::Trace::FAAS_TRIGGER] = 'http' - span_attributes.merge!(request_attributes) - end - - if event['Records'] - trigger_attributes = trigger_type_attributes(event) - span_attributes.merge!(trigger_attributes) - end - - span_attributes - rescue StandardError => e - OpenTelemetry.logger.error("aws-lambda instrumentation exception occurred while preparing span attributes: #{e.message}") - {} - end - - # sqs spec for lambda: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md#sqs - # current there is no spec for 'aws:sns', 'aws:s3' and 'aws:dynamodb' - def trigger_type_attributes(event) - attributes = {} - case event['Records'].dig(0, 'eventSource') - when 'aws:sqs' - attributes[OpenTelemetry::SemanticConventions::Trace::FAAS_TRIGGER] = 'pubsub' - attributes[OpenTelemetry::SemanticConventions::Trace::MESSAGING_OPERATION] = 'process' - attributes[OpenTelemetry::SemanticConventions::Trace::MESSAGING_SYSTEM] = 'AmazonSQS' - end - attributes - end end end end diff --git a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/instrumentation.rb b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/instrumentation.rb index 08566cac8..828ceb002 100644 --- a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/instrumentation.rb +++ b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/instrumentation.rb @@ -21,6 +21,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base private def require_dependencies + require_relative 'wrap' require_relative 'handler' end end diff --git a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/wrap.rb b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/wrap.rb new file mode 100644 index 000000000..655fb7b2b --- /dev/null +++ b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/wrap.rb @@ -0,0 +1,171 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +module OpenTelemetry + module Instrumentation + module AwsLambda + # Helper module that can be used to wrap a lambda handler method + module Wrap # rubocop:disable Metrics/ModuleLength + AWS_TRIGGERS = ['aws:sqs', 'aws:s3', 'aws:sns', 'aws:dynamodb'].freeze + DEFAULT_FLUSH_TIMEOUT = ENV.fetch('OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT', '30000').to_i + + def instrument_handler(method, flush_timeout: DEFAULT_FLUSH_TIMEOUT) + raise ArgumentError, "#{method} is not a method of #{name}" unless respond_to?(method) + + uninstrumented_method = "#{method}_without_instrumentation" + singleton_class.alias_method uninstrumented_method, method + + handler = "#{name}.#{method}" + + define_singleton_method(method) do |event:, context:| + wrap_lambda(event: event, context: context, handler: handler, flush_timeout: flush_timeout) { public_send(uninstrumented_method, event: event, context: context) } + end + end + + # Try to record and re-raise any exception from the wrapped function handler + # Instrumentation should never raise its own exception + def wrap_lambda(event:, context:, handler:, flush_timeout: DEFAULT_FLUSH_TIMEOUT) + parent_context = extract_parent_context(event) + + span_kind = if event['Records'] && AWS_TRIGGERS.include?(event['Records'].dig(0, 'eventSource')) + :consumer + else + :server + end + + original_handler_error = nil + original_response = nil + OpenTelemetry::Context.with_current(parent_context) do + tracer.in_span(handler, attributes: otel_attributes(event, context), kind: span_kind) do |span| + begin + response = yield + + unless span.attributes.key?(OpenTelemetry::SemanticConventions::Trace::HTTP_STATUS_CODE) + status_code = response['statusCode'] || response[:statusCode] if response.is_a?(Hash) + span.set_attribute(OpenTelemetry::SemanticConventions::Trace::HTTP_STATUS_CODE, status_code) if status_code + end + rescue StandardError => e + original_handler_error = e + ensure + original_response = response + end + if original_handler_error + span.record_exception(original_handler_error) + span.status = OpenTelemetry::Trace::Status.error(original_handler_error.message) + end + end + end + + OpenTelemetry.tracer_provider.force_flush(timeout: flush_timeout) + OpenTelemetry.meter_provider.force_flush(timeout: flush_timeout) if OpenTelemetry.respond_to?(:meter_provider) + + raise original_handler_error if original_handler_error + + original_response + end + + def instrumentation_config + AwsLambda::Instrumentation.instance.config + end + + def tracer + AwsLambda::Instrumentation.instance.tracer + end + + private + + # Extract parent context from request headers + # Downcase Traceparent and Tracestate because TraceContext::TextMapPropagator's TRACEPARENT_KEY and TRACESTATE_KEY are all lowercase + # If any error occur, rescue and give empty context + def extract_parent_context(event) + headers = event['headers'] || {} + headers.transform_keys! do |key| + %w[Traceparent Tracestate].include?(key) ? key.downcase : key + end + + OpenTelemetry.propagation.extract( + headers, + getter: OpenTelemetry::Context::Propagation.text_map_getter + ) + rescue StandardError => e + OpenTelemetry.logger.error("aws-lambda instrumentation exception occurred while extracting the parent context: #{e.message}") + OpenTelemetry::Context.empty + end + + # lambda event version 1.0 and version 2.0 + # https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html + def v1_proxy_attributes(event) + attributes = { + OpenTelemetry::SemanticConventions::Trace::HTTP_METHOD => event['httpMethod'], + OpenTelemetry::SemanticConventions::Trace::HTTP_ROUTE => event['resource'], + OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET => event['resource'] + } + attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET] += "?#{event['queryStringParameters']}" if event['queryStringParameters'] + + headers = event['headers'] + if headers + attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_USER_AGENT] = headers['User-Agent'] + attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_SCHEME] = headers['X-Forwarded-Proto'] + attributes[OpenTelemetry::SemanticConventions::Trace::NET_HOST_NAME] = headers['Host'] + end + attributes + end + + def v2_proxy_attributes(event) + request_context = event['requestContext'] + attributes = { + OpenTelemetry::SemanticConventions::Trace::NET_HOST_NAME => request_context['domainName'], + OpenTelemetry::SemanticConventions::Trace::HTTP_METHOD => request_context['http']['method'], + OpenTelemetry::SemanticConventions::Trace::HTTP_USER_AGENT => request_context['http']['userAgent'], + OpenTelemetry::SemanticConventions::Trace::HTTP_ROUTE => request_context['http']['path'], + OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET => request_context['http']['path'] + } + attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET] += "?#{event['rawQueryString']}" if event['rawQueryString'] + attributes + end + + # fass.trigger set to http: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md#api-gateway + # TODO: need to update Semantic Conventions for invocation_id, trigger and resource_id + def otel_attributes(event, context) + span_attributes = {} + span_attributes['faas.invocation_id'] = context.aws_request_id + span_attributes['cloud.resource_id'] = context.invoked_function_arn + span_attributes[OpenTelemetry::SemanticConventions::Trace::AWS_LAMBDA_INVOKED_ARN] = context.invoked_function_arn + span_attributes[OpenTelemetry::SemanticConventions::Resource::CLOUD_ACCOUNT_ID] = context.invoked_function_arn.split(':')[4] + + if event['requestContext'] + request_attributes = event['version'] == '2.0' ? v2_proxy_attributes(event) : v1_proxy_attributes(event) + request_attributes[OpenTelemetry::SemanticConventions::Trace::FAAS_TRIGGER] = 'http' + span_attributes.merge!(request_attributes) + end + + if event['Records'] + trigger_attributes = trigger_type_attributes(event) + span_attributes.merge!(trigger_attributes) + end + + span_attributes + rescue StandardError => e + OpenTelemetry.logger.error("aws-lambda instrumentation exception occurred while preparing span attributes: #{e.message}") + {} + end + + # sqs spec for lambda: https://github.com/open-telemetry/semantic-conventions/blob/main/docs/faas/aws-lambda.md#sqs + # current there is no spec for 'aws:sns', 'aws:s3' and 'aws:dynamodb' + def trigger_type_attributes(event) + attributes = {} + case event['Records'].dig(0, 'eventSource') + when 'aws:sqs' + attributes[OpenTelemetry::SemanticConventions::Trace::FAAS_TRIGGER] = 'pubsub' + attributes[OpenTelemetry::SemanticConventions::Trace::MESSAGING_OPERATION] = 'process' + attributes[OpenTelemetry::SemanticConventions::Trace::MESSAGING_SYSTEM] = 'AmazonSQS' + end + attributes + end + end + end + end +end diff --git a/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb b/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb index 92ae0fc8a..c45525c5a 100644 --- a/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb +++ b/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb @@ -235,4 +235,98 @@ end end end + + describe 'validate_instrument_handler' do + let(:expected_flush_timeout) { 30_000 } + let(:expected_handler) { 'Handler.process' } + let(:method_name) { :process } + + before do + Handler = Class.new do + extend OpenTelemetry::Instrumentation::AwsLambda::Wrap + + def self.process(event:, context:) + { 'statusCode' => 200 } + end + end + end + + after do + Object.send(:remove_const, :Handler) + end + + describe 'when handler method is defined' do + describe 'when a flush_timeout is not provided' do + before do + Handler.instrument_handler(method_name) + end + + it 'calls wrap_lambda with correct arguments' do + args_checker = proc do |event:, context:, handler:, flush_timeout:| + _(event).must_equal event_v1 + _(context).must_equal context + _(handler).must_equal expected_handler + _(flush_timeout).must_equal expected_flush_timeout + end + + Handler.stub(:wrap_lambda, args_checker) do + Handler.process(event: event_v1, context: context) + end + end + + it 'calls the original method with correct arguments' do + args_checker = proc do |event:, context:| + _(event).must_equal event_v1 + _(context).must_equal context + end + + Handler.stub(:process_without_instrumentation, args_checker) do + Handler.process(event: event_v1, context: context) + end + end + end + + describe 'when a flush_timeout is provided' do + let(:expected_flush_timeout) { 10_000 } + + before do + Handler.instrument_handler(:process, flush_timeout: expected_flush_timeout) + end + + it 'calls wrap_lambda with correct arguments' do + args_checker = proc do |event:, context:, handler:, flush_timeout:| + _(event).must_equal event_v1 + _(context).must_equal context + _(handler).must_equal expected_handler + _(flush_timeout).must_equal expected_flush_timeout + end + + Handler.stub(:wrap_lambda, args_checker) do + Handler.process(event: event_v1, context: context) + end + end + + it 'calls the original method with correct arguments' do + args_checker = proc do |event:, context:| + _(event).must_equal event_v1 + _(context).must_equal context + end + + Handler.stub(:process_without_instrumentation, args_checker) do + Handler.process(event: event_v1, context: context) + end + end + end + end + + describe 'when handler method is not defined' do + let(:method_name) { :dummy } + + it 'raises ArgumentError' do + assert_raises ArgumentError, "#{method_name} is not a method of Handler" do + Handler.instrument_handler(method_name) + end + end + end + end end From d0444dfd6b12b53df3593bc56c982d10bfcc5f4e Mon Sep 17 00:00:00 2001 From: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com> Date: Wed, 29 Jan 2025 18:24:45 -0800 Subject: [PATCH 12/20] chore: bump simplecov to 0.22.0 (#1378) --- helpers/sql/opentelemetry-helpers-sql.gemspec | 2 +- .../opentelemetry-instrumentation-action_mailer.gemspec | 2 +- .../opentelemetry-instrumentation-action_pack.gemspec | 2 +- .../opentelemetry-instrumentation-action_view.gemspec | 2 +- .../active_job/opentelemetry-instrumentation-active_job.gemspec | 2 +- ...entelemetry-instrumentation-active_model_serializers.gemspec | 2 +- .../opentelemetry-instrumentation-active_record.gemspec | 2 +- .../opentelemetry-instrumentation-active_storage.gemspec | 2 +- .../opentelemetry-instrumentation-active_support.gemspec | 2 +- instrumentation/all/opentelemetry-instrumentation-all.gemspec | 2 +- .../aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec | 2 +- .../aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec | 2 +- .../bunny/opentelemetry-instrumentation-bunny.gemspec | 2 +- .../opentelemetry-instrumentation-concurrent_ruby.gemspec | 2 +- .../dalli/opentelemetry-instrumentation-dalli.gemspec | 2 +- .../opentelemetry-instrumentation-delayed_job.gemspec | 2 +- .../ethon/opentelemetry-instrumentation-ethon.gemspec | 2 +- .../excon/opentelemetry-instrumentation-excon.gemspec | 2 +- .../faraday/opentelemetry-instrumentation-faraday.gemspec | 2 +- .../grape/opentelemetry-instrumentation-grape.gemspec | 2 +- .../graphql/opentelemetry-instrumentation-graphql.gemspec | 2 +- instrumentation/grpc/opentelemetry-instrumentation-grpc.gemspec | 2 +- instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec | 2 +- instrumentation/http/opentelemetry-instrumentation-http.gemspec | 2 +- .../opentelemetry-instrumentation-http_client.gemspec | 2 +- .../httpx/opentelemetry-instrumentation-httpx.gemspec | 2 +- .../koala/opentelemetry-instrumentation-koala.gemspec | 2 +- instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec | 2 +- .../mongo/opentelemetry-instrumentation-mongo.gemspec | 2 +- .../mysql2/opentelemetry-instrumentation-mysql2.gemspec | 2 +- .../net_http/opentelemetry-instrumentation-net_http.gemspec | 2 +- instrumentation/pg/opentelemetry-instrumentation-pg.gemspec | 2 +- instrumentation/que/opentelemetry-instrumentation-que.gemspec | 2 +- .../racecar/opentelemetry-instrumentation-racecar.gemspec | 2 +- instrumentation/rack/opentelemetry-instrumentation-rack.gemspec | 2 +- instrumentation/rake/opentelemetry-instrumentation-rake.gemspec | 2 +- .../rdkafka/opentelemetry-instrumentation-rdkafka.gemspec | 2 +- .../redis/opentelemetry-instrumentation-redis.gemspec | 2 +- .../resque/opentelemetry-instrumentation-resque.gemspec | 2 +- .../restclient/opentelemetry-instrumentation-restclient.gemspec | 2 +- .../rspec/opentelemetry-instrumentation-rspec.gemspec | 2 +- .../ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec | 2 +- .../sidekiq/opentelemetry-instrumentation-sidekiq.gemspec | 2 +- .../sinatra/opentelemetry-instrumentation-sinatra.gemspec | 2 +- .../trilogy/opentelemetry-instrumentation-trilogy.gemspec | 2 +- resources/azure/opentelemetry-resource-detector-azure.gemspec | 2 +- .../container/opentelemetry-resource-detector-container.gemspec | 2 +- ...pentelemetry-resource-detector-google_cloud_platform.gemspec | 2 +- 48 files changed, 48 insertions(+), 48 deletions(-) diff --git a/helpers/sql/opentelemetry-helpers-sql.gemspec b/helpers/sql/opentelemetry-helpers-sql.gemspec index d006d9211..055c76f31 100644 --- a/helpers/sql/opentelemetry-helpers-sql.gemspec +++ b/helpers/sql/opentelemetry-helpers-sql.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/action_mailer/opentelemetry-instrumentation-action_mailer.gemspec b/instrumentation/action_mailer/opentelemetry-instrumentation-action_mailer.gemspec index b315f5412..5a72e1906 100644 --- a/instrumentation/action_mailer/opentelemetry-instrumentation-action_mailer.gemspec +++ b/instrumentation/action_mailer/opentelemetry-instrumentation-action_mailer.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/action_pack/opentelemetry-instrumentation-action_pack.gemspec b/instrumentation/action_pack/opentelemetry-instrumentation-action_pack.gemspec index 23dcda624..625dd0a91 100644 --- a/instrumentation/action_pack/opentelemetry-instrumentation-action_pack.gemspec +++ b/instrumentation/action_pack/opentelemetry-instrumentation-action_pack.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/action_view/opentelemetry-instrumentation-action_view.gemspec b/instrumentation/action_view/opentelemetry-instrumentation-action_view.gemspec index dfb773985..2a2baed86 100644 --- a/instrumentation/action_view/opentelemetry-instrumentation-action_view.gemspec +++ b/instrumentation/action_view/opentelemetry-instrumentation-action_view.gemspec @@ -38,7 +38,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/active_job/opentelemetry-instrumentation-active_job.gemspec b/instrumentation/active_job/opentelemetry-instrumentation-active_job.gemspec index 5952bc6c3..a9ff0d8c3 100644 --- a/instrumentation/active_job/opentelemetry-instrumentation-active_job.gemspec +++ b/instrumentation/active_job/opentelemetry-instrumentation-active_job.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/active_model_serializers/opentelemetry-instrumentation-active_model_serializers.gemspec b/instrumentation/active_model_serializers/opentelemetry-instrumentation-active_model_serializers.gemspec index ac719b790..4433473c9 100644 --- a/instrumentation/active_model_serializers/opentelemetry-instrumentation-active_model_serializers.gemspec +++ b/instrumentation/active_model_serializers/opentelemetry-instrumentation-active_model_serializers.gemspec @@ -38,7 +38,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/active_record/opentelemetry-instrumentation-active_record.gemspec b/instrumentation/active_record/opentelemetry-instrumentation-active_record.gemspec index a58e2c04f..7e85a6c9a 100644 --- a/instrumentation/active_record/opentelemetry-instrumentation-active_record.gemspec +++ b/instrumentation/active_record/opentelemetry-instrumentation-active_record.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/active_storage/opentelemetry-instrumentation-active_storage.gemspec b/instrumentation/active_storage/opentelemetry-instrumentation-active_storage.gemspec index cc7e0206b..68e22175e 100644 --- a/instrumentation/active_storage/opentelemetry-instrumentation-active_storage.gemspec +++ b/instrumentation/active_storage/opentelemetry-instrumentation-active_storage.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.70.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/active_support/opentelemetry-instrumentation-active_support.gemspec b/instrumentation/active_support/opentelemetry-instrumentation-active_support.gemspec index 956383e3f..ee346d85d 100644 --- a/instrumentation/active_support/opentelemetry-instrumentation-active_support.gemspec +++ b/instrumentation/active_support/opentelemetry-instrumentation-active_support.gemspec @@ -40,7 +40,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/all/opentelemetry-instrumentation-all.gemspec b/instrumentation/all/opentelemetry-instrumentation-all.gemspec index c3d46c7f3..53b6b65c2 100644 --- a/instrumentation/all/opentelemetry-instrumentation-all.gemspec +++ b/instrumentation/all/opentelemetry-instrumentation-all.gemspec @@ -68,7 +68,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec b/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec index 6d1ed60e3..a7bed08ce 100644 --- a/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec +++ b/instrumentation/aws_lambda/opentelemetry-instrumentation-aws_lambda.gemspec @@ -38,7 +38,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec b/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec index 6c2f894d1..1d2b23b8b 100644 --- a/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec +++ b/instrumentation/aws_sdk/opentelemetry-instrumentation-aws_sdk.gemspec @@ -39,7 +39,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec b/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec index b5b226983..47536f452 100644 --- a/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec +++ b/instrumentation/bunny/opentelemetry-instrumentation-bunny.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec b/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec index 608f17c73..66eb21b11 100644 --- a/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec +++ b/instrumentation/concurrent_ruby/opentelemetry-instrumentation-concurrent_ruby.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec b/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec index 80ba31737..95e8d91c1 100644 --- a/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec +++ b/instrumentation/dalli/opentelemetry-instrumentation-dalli.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec b/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec index aa4ef79aa..7e3fe3a71 100644 --- a/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec +++ b/instrumentation/delayed_job/opentelemetry-instrumentation-delayed_job.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'sqlite3' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec b/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec index 1b52907c5..e17edf6ed 100644 --- a/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec +++ b/instrumentation/ethon/opentelemetry-instrumentation-ethon.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec b/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec index 0d8af867d..4c6006c9b 100644 --- a/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec +++ b/instrumentation/excon/opentelemetry-instrumentation-excon.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec b/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec index de4f07bb5..fc67d48b7 100644 --- a/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec +++ b/instrumentation/faraday/opentelemetry-instrumentation-faraday.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec b/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec index a8fe134d6..6eb4671e0 100644 --- a/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec +++ b/instrumentation/grape/opentelemetry-instrumentation-grape.gemspec @@ -40,7 +40,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec b/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec index caab57867..4646b41b2 100644 --- a/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec +++ b/instrumentation/graphql/opentelemetry-instrumentation-graphql.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/grpc/opentelemetry-instrumentation-grpc.gemspec b/instrumentation/grpc/opentelemetry-instrumentation-grpc.gemspec index 5f6cf9cef..5839a7179 100644 --- a/instrumentation/grpc/opentelemetry-instrumentation-grpc.gemspec +++ b/instrumentation/grpc/opentelemetry-instrumentation-grpc.gemspec @@ -46,7 +46,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.2' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' # For more information and examples about making a new gem, check out our diff --git a/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec b/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec index 0de2692dd..374500e67 100644 --- a/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec +++ b/instrumentation/gruf/opentelemetry-instrumentation-gruf.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 12.3.3' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/http/opentelemetry-instrumentation-http.gemspec b/instrumentation/http/opentelemetry-instrumentation-http.gemspec index e07f8a4f4..e7e3076ab 100644 --- a/instrumentation/http/opentelemetry-instrumentation-http.gemspec +++ b/instrumentation/http/opentelemetry-instrumentation-http.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec b/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec index 85730d438..4db1c0e74 100644 --- a/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec +++ b/instrumentation/http_client/opentelemetry-instrumentation-http_client.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec b/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec index e99741829..21e32269c 100644 --- a/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec +++ b/instrumentation/httpx/opentelemetry-instrumentation-httpx.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec b/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec index bcc202389..5baaaa202 100644 --- a/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec +++ b/instrumentation/koala/opentelemetry-instrumentation-koala.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec b/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec index 059fc3de7..5eed8a275 100644 --- a/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec +++ b/instrumentation/lmdb/opentelemetry-instrumentation-lmdb.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec b/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec index 51fd7d762..61460cf21 100644 --- a/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec +++ b/instrumentation/mongo/opentelemetry-instrumentation-mongo.gemspec @@ -38,7 +38,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec b/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec index 6789d4e2a..d217b42f9 100644 --- a/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec +++ b/instrumentation/mysql2/opentelemetry-instrumentation-mysql2.gemspec @@ -40,7 +40,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec b/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec index 729f5d04d..19265107a 100644 --- a/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec +++ b/instrumentation/net_http/opentelemetry-instrumentation-net_http.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec index c36e2b867..70e2b17f6 100644 --- a/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec +++ b/instrumentation/pg/opentelemetry-instrumentation-pg.gemspec @@ -39,7 +39,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry-byebug' unless RUBY_ENGINE == 'jruby' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/que/opentelemetry-instrumentation-que.gemspec b/instrumentation/que/opentelemetry-instrumentation-que.gemspec index 759edd0d8..f8b2a4f4b 100644 --- a/instrumentation/que/opentelemetry-instrumentation-que.gemspec +++ b/instrumentation/que/opentelemetry-instrumentation-que.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec b/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec index 324305214..4e2671bca 100644 --- a/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec +++ b/instrumentation/racecar/opentelemetry-instrumentation-racecar.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec b/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec index 04c6fbe58..1188a146a 100644 --- a/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec +++ b/instrumentation/rack/opentelemetry-instrumentation-rack.gemspec @@ -38,7 +38,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec b/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec index 31a8e7b26..47d420722 100644 --- a/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec +++ b/instrumentation/rake/opentelemetry-instrumentation-rake.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec b/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec index f126d964c..f1f8c2817 100644 --- a/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec +++ b/instrumentation/rdkafka/opentelemetry-instrumentation-rdkafka.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec b/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec index 2b87e0966..892e75aaa 100644 --- a/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec +++ b/instrumentation/redis/opentelemetry-instrumentation-redis.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec b/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec index a3b198e75..b0b8cd737 100644 --- a/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec +++ b/instrumentation/resque/opentelemetry-instrumentation-resque.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec b/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec index 90d4fd330..0420dff30 100644 --- a/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec +++ b/instrumentation/restclient/opentelemetry-instrumentation-restclient.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec b/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec index f3b472fdd..933ce4d59 100644 --- a/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec +++ b/instrumentation/rspec/opentelemetry-instrumentation-rspec.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec b/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec index f258a0b73..ec5e43d0d 100644 --- a/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec +++ b/instrumentation/ruby_kafka/opentelemetry-instrumentation-ruby_kafka.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec b/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec index 1c7092449..1b45f0f24 100644 --- a/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec +++ b/instrumentation/sidekiq/opentelemetry-instrumentation-sidekiq.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec b/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec index ed7f7dacb..4c4bf7ed4 100644 --- a/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec +++ b/instrumentation/sinatra/opentelemetry-instrumentation-sinatra.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rack-test', '~> 2.1' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec b/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec index 2899a12f4..a5296365d 100644 --- a/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec +++ b/instrumentation/trilogy/opentelemetry-instrumentation-trilogy.gemspec @@ -43,7 +43,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-mocks' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17.1' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/resources/azure/opentelemetry-resource-detector-azure.gemspec b/resources/azure/opentelemetry-resource-detector-azure.gemspec index ad133a8a1..3c555d598 100644 --- a/resources/azure/opentelemetry-resource-detector-azure.gemspec +++ b/resources/azure/opentelemetry-resource-detector-azure.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' diff --git a/resources/container/opentelemetry-resource-detector-container.gemspec b/resources/container/opentelemetry-resource-detector-container.gemspec index c97a631d0..5a5263071 100644 --- a/resources/container/opentelemetry-resource-detector-container.gemspec +++ b/resources/container/opentelemetry-resource-detector-container.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'yard', '~> 0.9' if spec.respond_to?(:metadata) diff --git a/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec b/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec index 6f3102bc9..e61687539 100644 --- a/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec +++ b/resources/google_cloud_platform/opentelemetry-resource-detector-google_cloud_platform.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rake', '~> 13.0' spec.add_development_dependency 'rubocop', '~> 1.71.0' spec.add_development_dependency 'rubocop-performance', '~> 1.23.0' - spec.add_development_dependency 'simplecov', '~> 0.17' + spec.add_development_dependency 'simplecov', '~> 0.22.0' spec.add_development_dependency 'webmock', '~> 3.24.0' spec.add_development_dependency 'yard', '~> 0.9' From 1e9853aa5ff5358aca0c572dafa5db40c2168442 Mon Sep 17 00:00:00 2001 From: Alex Kahn Date: Thu, 30 Jan 2025 11:13:42 -0500 Subject: [PATCH 13/20] feat: Strip Rails `(.:format)` suffix from `http.route` (#1375) * chore: Strip Rails (.:format) suffix from http.route * test: Add test for http.route cleaning --------- Co-authored-by: Ariel Valentin --- .../action_pack/handlers/action_controller.rb | 4 ++-- .../action_pack/handlers/action_controller_test.rb | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb b/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb index 843af4633..133afb003 100644 --- a/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb +++ b/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/handlers/action_controller.rb @@ -53,7 +53,7 @@ def finish(_name, _id, payload) # @return [Array] the span name and attributes def to_span_name_and_attributes(payload) request = payload[:request] - http_route = request.route_uri_pattern if request.respond_to?(:route_uri_pattern) + http_route = request.route_uri_pattern.chomp('(.:format)') if request.respond_to?(:route_uri_pattern) attributes = { OpenTelemetry::SemanticConventions::Trace::CODE_NAMESPACE => String(payload[:controller]), @@ -63,7 +63,7 @@ def to_span_name_and_attributes(payload) attributes[OpenTelemetry::SemanticConventions::Trace::HTTP_TARGET] = request.filtered_path if request.filtered_path != request.fullpath if @span_naming == :semconv - return ["#{request.method} #{http_route.gsub('(.:format)', '')}", attributes] if http_route + return ["#{request.method} #{http_route}", attributes] if http_route return ["#{request.method} /#{payload.dig(:params, :controller)}/#{payload.dig(:params, :action)}", attributes] end diff --git a/instrumentation/action_pack/test/opentelemetry/instrumentation/action_pack/handlers/action_controller_test.rb b/instrumentation/action_pack/test/opentelemetry/instrumentation/action_pack/handlers/action_controller_test.rb index bec7648c5..8ce892443 100644 --- a/instrumentation/action_pack/test/opentelemetry/instrumentation/action_pack/handlers/action_controller_test.rb +++ b/instrumentation/action_pack/test/opentelemetry/instrumentation/action_pack/handlers/action_controller_test.rb @@ -58,6 +58,14 @@ _(span.attributes['code.function']).must_equal 'ok' end + it 'strips (:format) from http.route' do + skip "Rails #{Rails.gem_version} does not define ActionDispatch::Request#route_uri_pattern" if Rails.gem_version < Gem::Version.new('7.1') + + get 'items/1234' + + _(span.attributes['http.route']).must_equal '/items/:id' + end + it 'does not memoize data across requests' do get '/ok' get '/items/new' From 5c0b75bc22f17e6f36d763fa39a43655e2b6fd4e Mon Sep 17 00:00:00 2001 From: Zach Kemp Date: Thu, 30 Jan 2025 11:43:58 -0500 Subject: [PATCH 14/20] fix: do not expose auth params with Redis 5 (#1370) Additionally: - Add a redis 5 appraisal - use RedisClient in RedisClient tests Co-authored-by: Ariel Valentin --- instrumentation/redis/Appraisals | 4 + .../redis/middlewares/redis_client.rb | 2 +- .../redis/patches/client_test.rb | 207 +++++++++++++++--- .../instrumentation/redis_client_test.rb | 58 +++-- 4 files changed, 228 insertions(+), 43 deletions(-) diff --git a/instrumentation/redis/Appraisals b/instrumentation/redis/Appraisals index 7939892cf..abb68fa4b 100644 --- a/instrumentation/redis/Appraisals +++ b/instrumentation/redis/Appraisals @@ -4,3 +4,7 @@ appraise 'redis-4.x' do gem 'redis-client', '~> 0.22' gem 'redis', '~> 4.8' end + +appraise 'redis-5.x' do + gem 'redis', '~> 5.0' +end diff --git a/instrumentation/redis/lib/opentelemetry/instrumentation/redis/middlewares/redis_client.rb b/instrumentation/redis/lib/opentelemetry/instrumentation/redis/middlewares/redis_client.rb index dec9c1c7e..7599cf3f5 100644 --- a/instrumentation/redis/lib/opentelemetry/instrumentation/redis/middlewares/redis_client.rb +++ b/instrumentation/redis/lib/opentelemetry/instrumentation/redis/middlewares/redis_client.rb @@ -58,7 +58,7 @@ def serialize_commands(commands) serialized_commands = commands.map do |command| # If we receive an authentication request command we want to obfuscate it - if obfuscate || command[0].match?(/\A(AUTH|HELLO)\z/) + if obfuscate || command[0].match?(/\A(AUTH|HELLO)\z/i) command[0].to_s.upcase + (' ?' * (command.size - 1)) else command_copy = command.dup diff --git a/instrumentation/redis/test/opentelemetry/instrumentation/redis/patches/client_test.rb b/instrumentation/redis/test/opentelemetry/instrumentation/redis/patches/client_test.rb index 96a3cee7d..dc2e44fe5 100644 --- a/instrumentation/redis/test/opentelemetry/instrumentation/redis/patches/client_test.rb +++ b/instrumentation/redis/test/opentelemetry/instrumentation/redis/patches/client_test.rb @@ -10,6 +10,8 @@ require_relative '../../../../../lib/opentelemetry/instrumentation/redis/patches/redis_v4_client' describe OpenTelemetry::Instrumentation::Redis::Patches::RedisV4Client do + # NOTE: These tests should be run for redis v4 and redis v5, even though the patches won't be installed on v5. + # Perhaps these tests should live in a different file? let(:instrumentation) { OpenTelemetry::Instrumentation::Redis::Instrumentation.instance } let(:exporter) { EXPORTER } let(:password) { 'passw0rd' } @@ -21,12 +23,24 @@ # will generate one extra span on connect because the Redis client will # send an AUTH command before doing anything else. def redis_with_auth(redis_options = {}) - redis_options[:password] = password - redis_options[:host] = redis_host - redis_options[:port] = redis_port + redis_options[:password] ||= password + redis_options[:host] ||= redis_host + redis_options[:port] ||= redis_port Redis.new(redis_options) end + def redis_version + Gem.loaded_specs['redis']&.version + end + + def redis_version_major + redis_version&.segments&.first + end + + def redis_gte_5? + redis_version_major&.>=(5) + end + before do # ensure obfuscation is off if it was previously set in a different test config = { db_statement: :include } @@ -95,6 +109,8 @@ def redis_with_auth(redis_options = {}) end it 'reflects db index' do + skip if redis_gte_5? + redis = redis_with_auth(db: 1) redis.get('K') @@ -102,12 +118,40 @@ def redis_with_auth(redis_options = {}) select_span = exporter.finished_spans[1] _(select_span.name).must_equal 'SELECT' - _(select_span.attributes['db.system']).must_equal 'redis' _(select_span.attributes['db.statement']).must_equal('SELECT 1') + + get_span = exporter.finished_spans.last + + _(select_span.attributes['db.system']).must_equal 'redis' _(select_span.attributes['net.peer.name']).must_equal redis_host _(select_span.attributes['net.peer.port']).must_equal redis_port + _(select_span.attributes['db.redis.database_index']).must_equal 1 + _(get_span.name).must_equal 'GET' + _(get_span.attributes['db.system']).must_equal 'redis' + _(get_span.attributes['db.statement']).must_equal('GET K') + _(get_span.attributes['db.redis.database_index']).must_equal 1 + _(get_span.attributes['net.peer.name']).must_equal redis_host + _(get_span.attributes['net.peer.port']).must_equal redis_port + end + + it 'reflects db index v5' do + skip unless redis_gte_5? + + redis = redis_with_auth(db: 1) + redis.get('K') + + _(exporter.finished_spans.size).must_equal 2 + select_span = exporter.finished_spans.first get_span = exporter.finished_spans.last + _(select_span.name).must_equal 'PIPELINED' + _(select_span.attributes['db.statement']).must_equal("AUTH ?\nSELECT 1") + + _(select_span.attributes['db.system']).must_equal 'redis' + _(select_span.attributes['net.peer.name']).must_equal redis_host + _(select_span.attributes['net.peer.port']).must_equal redis_port + _(select_span.attributes['db.redis.database_index']).must_equal 1 + _(get_span.name).must_equal 'GET' _(get_span.attributes['db.system']).must_equal 'redis' _(get_span.attributes['db.statement']).must_equal('GET K') @@ -134,6 +178,8 @@ def redis_with_auth(redis_options = {}) end it 'records exceptions' do + skip if redis_gte_5? + expect do redis = redis_with_auth redis.call 'THIS_IS_NOT_A_REDIS_FUNC', 'THIS_IS_NOT_A_VALID_ARG' @@ -150,21 +196,68 @@ def redis_with_auth(redis_options = {}) _(last_span.status.code).must_equal( OpenTelemetry::Trace::Status::ERROR ) + _(last_span.status.description.tr('`', "'")).must_include( "ERR unknown command 'THIS_IS_NOT_A_REDIS_FUNC', with args beginning with: 'THIS_IS_NOT_A_VALID_ARG" ) end - it 'records net.peer.name and net.peer.port attributes' do + it 'records exceptions v5' do + skip unless redis_gte_5? + expect do - Redis.new(host: 'example.com', port: 8321, timeout: 0.01).auth(password) - end.must_raise Redis::CannotConnectError + redis = redis_with_auth + redis.call 'THIS_IS_NOT_A_REDIS_FUNC', 'THIS_IS_NOT_A_VALID_ARG' + end.must_raise Redis::CommandError - _(last_span.name).must_equal 'AUTH' + _(exporter.finished_spans.size).must_equal 2 + _(last_span.name).must_equal 'THIS_IS_NOT_A_REDIS_FUNC' _(last_span.attributes['db.system']).must_equal 'redis' - _(last_span.attributes['db.statement']).must_equal 'AUTH ?' - _(last_span.attributes['net.peer.name']).must_equal 'example.com' - _(last_span.attributes['net.peer.port']).must_equal 8321 + _(last_span.attributes['db.statement']).must_equal( + 'THIS_IS_NOT_A_REDIS_FUNC THIS_IS_NOT_A_VALID_ARG' + ) + _(last_span.attributes['net.peer.name']).must_equal redis_host + _(last_span.attributes['net.peer.port']).must_equal redis_port + _(last_span.status.code).must_equal( + OpenTelemetry::Trace::Status::ERROR + ) + + _(last_span.status.description.tr('`', "'")).must_include( + 'Unhandled exception of type: RedisClient::CommandError' + ) + end + + it 'records net.peer.name and net.peer.port attributes' do + skip if redis_gte_5? + + client = Redis.new(host: 'example.com', port: 8321, timeout: 0.01) + expect { client.auth(password) }.must_raise Redis::CannotConnectError + + if redis_gte_5? + skip( + 'Redis 5 is a wrapper around RedisClient, which calls' \ + '`ensure_connected` before any of the middlewares are invoked.' \ + 'This is more appropriately instrumented via a `#connect` hook in the middleware.' + ) + else + _(last_span.name).must_equal 'AUTH' + _(last_span.attributes['db.system']).must_equal 'redis' + _(last_span.attributes['db.statement']).must_equal 'AUTH ?' + _(last_span.attributes['net.peer.name']).must_equal 'example.com' + _(last_span.attributes['net.peer.port']).must_equal 8321 + end + end + + it 'records net.peer.name and net.peer.port attributes v5' do + skip unless redis_gte_5? + + client = Redis.new(host: 'example.com', port: 8321, timeout: 0.01) + expect { client.auth(password) }.must_raise Redis::CannotConnectError + + # NOTE: Redis 5 is a wrapper around RedisClient, which calls + # ensure_connected` before any of the middlewares are invoked, so we don't + # have a span here. This is more appropriately instrumented via a `#connect` + # hook in the middleware. end it 'traces pipelined commands' do @@ -185,10 +278,11 @@ def redis_with_auth(redis_options = {}) it 'traces pipelined commands on commit' do redis = redis_with_auth - redis.queue([:set, 'v1', '0']) - redis.queue([:incr, 'v1']) - redis.queue([:get, 'v1']) - redis.commit + redis.pipelined do |pipeline| + pipeline.set('v1', '0') + pipeline.incr('v1') + pipeline.get('v1') + end _(exporter.finished_spans.size).must_equal 2 _(last_span.name).must_equal 'PIPELINED' @@ -225,16 +319,17 @@ def redis_with_auth(redis_options = {}) it 'truncates long db.statements' do redis = redis_with_auth the_long_value = 'y' * 100 - redis.queue([:set, 'v1', the_long_value]) - redis.queue([:set, 'v1', the_long_value]) - redis.queue([:set, 'v1', the_long_value]) - redis.queue([:set, 'v1', the_long_value]) - redis.queue([:set, 'v1', the_long_value]) - redis.queue([:set, 'v1', the_long_value]) - redis.queue([:set, 'v1', the_long_value]) - redis.queue([:set, 'v1', the_long_value]) - redis.queue([:set, 'v1', the_long_value]) - redis.commit + redis.pipelined do |pipeline| + pipeline.set('v1', the_long_value) + pipeline.set('v1', the_long_value) + pipeline.set('v1', the_long_value) + pipeline.set('v1', the_long_value) + pipeline.set('v1', the_long_value) + pipeline.set('v1', the_long_value) + pipeline.set('v1', the_long_value) + pipeline.set('v1', the_long_value) + pipeline.set('v1', the_long_value) + end expected_db_statement = <<~HEREDOC.chomp SET v1 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy @@ -291,13 +386,39 @@ def redis_with_auth(redis_options = {}) end it 'omits db.statement attribute' do + skip if redis_gte_5? + + redis = redis_with_auth + _(redis.set('K', 'xyz')).must_equal 'OK' + _(redis.get('K')).must_equal 'xyz' + _(exporter.finished_spans.size).must_equal 3 + + set_span = exporter.finished_spans[0] + _(set_span.name).must_equal('AUTH') + _(set_span.attributes['db.system']).must_equal 'redis' + _(set_span.attributes).wont_include('db.statement') + + set_span = exporter.finished_spans[1] + _(set_span.name).must_equal 'SET' + _(set_span.attributes['db.system']).must_equal 'redis' + _(set_span.attributes).wont_include('db.statement') + + set_span = exporter.finished_spans[2] + _(set_span.name).must_equal 'GET' + _(set_span.attributes['db.system']).must_equal 'redis' + _(set_span.attributes).wont_include('db.statement') + end + + it 'omits db.statement attribute v5' do + skip unless redis_gte_5? + redis = redis_with_auth _(redis.set('K', 'xyz')).must_equal 'OK' _(redis.get('K')).must_equal 'xyz' _(exporter.finished_spans.size).must_equal 3 set_span = exporter.finished_spans[0] - _(set_span.name).must_equal 'AUTH' + _(set_span.name).must_equal('PIPELINED') _(set_span.attributes['db.system']).must_equal 'redis' _(set_span.attributes).wont_include('db.statement') @@ -320,13 +441,45 @@ def redis_with_auth(redis_options = {}) end it 'obfuscates arguments in db.statement' do + skip if redis_gte_5? + + redis = redis_with_auth + _(redis.set('K', 'xyz')).must_equal 'OK' + _(redis.get('K')).must_equal 'xyz' + _(exporter.finished_spans.size).must_equal 3 + + set_span = exporter.finished_spans[0] + _(set_span.name).must_equal('AUTH') + _(set_span.attributes['db.system']).must_equal 'redis' + _(set_span.attributes['db.statement']).must_equal( + 'AUTH ?' + ) + + set_span = exporter.finished_spans[1] + _(set_span.name).must_equal 'SET' + _(set_span.attributes['db.system']).must_equal 'redis' + _(set_span.attributes['db.statement']).must_equal( + 'SET ? ?' + ) + + set_span = exporter.finished_spans[2] + _(set_span.name).must_equal 'GET' + _(set_span.attributes['db.system']).must_equal 'redis' + _(set_span.attributes['db.statement']).must_equal( + 'GET ?' + ) + end + + it 'obfuscates arguments in db.statement v5' do + skip unless redis_gte_5? + redis = redis_with_auth _(redis.set('K', 'xyz')).must_equal 'OK' _(redis.get('K')).must_equal 'xyz' _(exporter.finished_spans.size).must_equal 3 set_span = exporter.finished_spans[0] - _(set_span.name).must_equal 'AUTH' + _(set_span.name).must_equal('PIPELINED') _(set_span.attributes['db.system']).must_equal 'redis' _(set_span.attributes['db.statement']).must_equal( 'AUTH ?' diff --git a/instrumentation/redis/test/opentelemetry/instrumentation/redis_client_test.rb b/instrumentation/redis/test/opentelemetry/instrumentation/redis_client_test.rb index 4b0e5bbe6..b65a451cb 100644 --- a/instrumentation/redis/test/opentelemetry/instrumentation/redis_client_test.rb +++ b/instrumentation/redis/test/opentelemetry/instrumentation/redis_client_test.rb @@ -21,10 +21,12 @@ # will generate one extra span on connect because the Redis client will # send an AUTH command before doing anything else. def redis_with_auth(redis_options = {}) - redis_options[:password] = password - redis_options[:host] = redis_host - redis_options[:port] = redis_port - RedisClient.new(**redis_options) + redis_options[:password] ||= password + redis_options[:host] ||= redis_host + redis_options[:port] ||= redis_port + RedisClient.new(**redis_options).tap do |client| + client.send(:raw_connection) # force lazy client to connect + end end before do @@ -45,7 +47,7 @@ def redis_with_auth(redis_options = {}) it 'accepts peer service name from config' do instrumentation.instance_variable_set(:@installed, false) instrumentation.install(peer_service: 'readonly:redis') - Redis.new(host: redis_host, port: redis_port).auth(password) + redis_with_auth _(last_span.attributes['peer.service']).must_equal 'readonly:redis' end @@ -63,7 +65,31 @@ def redis_with_auth(redis_options = {}) end it 'after authorization with Redis server' do - Redis.new(host: redis_host, port: redis_port).auth(password) + client = redis_with_auth + + _(client.connected?).must_equal(true) + + _(last_span.name).must_equal 'PIPELINED' + _(last_span.attributes['db.system']).must_equal 'redis' + _(last_span.attributes['db.statement']).must_equal 'HELLO ? ? ? ?' + _(last_span.attributes['net.peer.name']).must_equal redis_host + _(last_span.attributes['net.peer.port']).must_equal redis_port + end + + it 'after calling auth lowercase' do + client = redis_with_auth + client.call('auth', password) + + _(last_span.name).must_equal 'AUTH' + _(last_span.attributes['db.system']).must_equal 'redis' + _(last_span.attributes['db.statement']).must_equal 'AUTH ?' + _(last_span.attributes['net.peer.name']).must_equal redis_host + _(last_span.attributes['net.peer.port']).must_equal redis_port + end + + it 'after calling AUTH uppercase' do + client = redis_with_auth + client.call('AUTH', password) _(last_span.name).must_equal 'AUTH' _(last_span.attributes['db.system']).must_equal 'redis' @@ -155,16 +181,18 @@ def redis_with_auth(redis_options = {}) ) end - it 'records net.peer.name and net.peer.port attributes' do + it 'connect is uninstrumented' do expect do - Redis.new(host: 'example.com', port: 8321, timeout: 0.01).auth(password) - end.must_raise Redis::CannotConnectError - - _(last_span.name).must_equal 'AUTH' - _(last_span.attributes['db.system']).must_equal 'redis' - _(last_span.attributes['db.statement']).must_equal 'AUTH ?' - _(last_span.attributes['net.peer.name']).must_equal 'example.com' - _(last_span.attributes['net.peer.port']).must_equal 8321 + redis_with_auth(host: 'example.com', port: 8321, timeout: 0.01) + end.must_raise RedisClient::CannotConnectError + + # NOTE: RedisClient runs `ensure_connected` before Otel's instrumentation + # span is created. The 'connect' operation can be separately instrumented + # via the connect hook in the middleware. If this expectation (last_span must be nil) + # fails due to this implementation, it can be removed. + # This test remains here for parity the the V4 instrumentation, which _does_ + # wrap the connect failure in a span. + _(last_span).must_be_nil end it 'traces pipelined commands' do From 4db8fc9bbd9bd267ef7fba3490b956604e0aa543 Mon Sep 17 00:00:00 2001 From: Xuan <112967240+xuan-cao-swi@users.noreply.github.com> Date: Thu, 30 Jan 2025 13:53:07 -0500 Subject: [PATCH 15/20] fix: aws_lambda test fix (#1383) * fix: aws_lambda test fix * use assert_equal * lint --- .../test/opentelemetry/instrumentation_test.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb b/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb index c45525c5a..648a4ad62 100644 --- a/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb +++ b/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb @@ -76,7 +76,8 @@ _(last_span.hex_span_id.size).must_equal 16 _(last_span.hex_trace_id.size).must_equal 32 _(last_span.trace_flags.sampled?).must_equal true - _(last_span.tracestate.to_h.to_s).must_equal '{}' + + assert_equal last_span.tracestate, {} end end @@ -95,7 +96,8 @@ _(last_span.hex_span_id.size).must_equal 16 _(last_span.hex_trace_id.size).must_equal 32 _(last_span.trace_flags.sampled?).must_equal true - _(last_span.tracestate.to_h.to_s).must_equal '{"otel"=>"ff40ea9699e62af2-01"}' + + assert_equal last_span.tracestate, { 'otel' => 'ff40ea9699e62af2-01' } end event_v1['headers'].delete('traceparent') event_v1['headers'].delete('tracestate') @@ -195,7 +197,8 @@ _(last_span.hex_span_id.size).must_equal 16 _(last_span.hex_trace_id.size).must_equal 32 _(last_span.trace_flags.sampled?).must_equal true - _(last_span.tracestate.to_h.to_s).must_equal '{}' + + assert_equal last_span.tracestate, {} end end From 46732725423acec0cea6fdae62b36884e53aed06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 00:02:21 -0600 Subject: [PATCH 16/20] chore: bump ruby/setup-ruby from 1.214.0 to 1.215.0 (#1386) * chore: bump ruby/setup-ruby from 1.214.0 to 1.215.0 Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.214.0 to 1.215.0. - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/v1.214.0...v1.215.0) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * squash: bump shared actions --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ariel Valentin --- .github/actions/test_gem/action.yml | 4 ++-- .github/workflows/installation-tests.yml | 2 +- .github/workflows/release-hook-on-closed.yml | 2 +- .github/workflows/release-hook-on-push.yml | 2 +- .github/workflows/release-perform.yml | 2 +- .github/workflows/release-please.yaml | 2 +- .github/workflows/release-request-weekly.yml | 2 +- .github/workflows/release-request.yml | 2 +- .github/workflows/release-retry.yml | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/actions/test_gem/action.yml b/.github/actions/test_gem/action.yml index 276452354..ce6461f96 100644 --- a/.github/actions/test_gem/action.yml +++ b/.github/actions/test_gem/action.yml @@ -84,7 +84,7 @@ runs: # ...but not for appraisals, sadly. - name: Install Ruby ${{ inputs.ruby }} with dependencies if: "${{ steps.setup.outputs.appraisals == 'false' }}" - uses: ruby/setup-ruby@v1.214.0 + uses: ruby/setup-ruby@v1.215.0 with: ruby-version: "${{ inputs.ruby }}" working-directory: "${{ steps.setup.outputs.gem_dir }}" @@ -95,7 +95,7 @@ runs: # If we're using appraisals, do it all manually. - name: Install Ruby ${{ inputs.ruby }} without dependencies if: "${{ steps.setup.outputs.appraisals == 'true' }}" - uses: ruby/setup-ruby@v1.214.0 + uses: ruby/setup-ruby@v1.215.0 with: ruby-version: "${{ inputs.ruby }}" bundler: "latest" diff --git a/.github/workflows/installation-tests.yml b/.github/workflows/installation-tests.yml index 12a0a1448..1a3d5da58 100644 --- a/.github/workflows/installation-tests.yml +++ b/.github/workflows/installation-tests.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v4 # ATTENTION: Dependabot does not know how to update shared actions file. # If you see it update setup-ruby here also update it as part of actions/test_gem/action.yml - - uses: ruby/setup-ruby@v1.214.0 + - uses: ruby/setup-ruby@v1.215.0 with: ruby-version: ${{ matrix.ruby-version }} - name: "Install Latest Gem Versions on ${{ matrix.ruby-version }}" diff --git a/.github/workflows/release-hook-on-closed.yml b/.github/workflows/release-hook-on-closed.yml index d9979bb2c..83805a136 100644 --- a/.github/workflows/release-hook-on-closed.yml +++ b/.github/workflows/release-hook-on-closed.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.214.0 + uses: ruby/setup-ruby@v1.215.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-hook-on-push.yml b/.github/workflows/release-hook-on-push.yml index 07ba1e07d..e2dffd194 100644 --- a/.github/workflows/release-hook-on-push.yml +++ b/.github/workflows/release-hook-on-push.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.214.0 + uses: ruby/setup-ruby@v1.215.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-perform.yml b/.github/workflows/release-perform.yml index d158477f3..9e88c3565 100644 --- a/.github/workflows/release-perform.yml +++ b/.github/workflows/release-perform.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.214.0 + uses: ruby/setup-ruby@v1.215.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index 49f610cd3..e0bcb1ea5 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -50,7 +50,7 @@ jobs: chmod 0600 $HOME/.gem/credentials printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - - uses: ruby/setup-ruby@v1.214.0 + - uses: ruby/setup-ruby@v1.215.0 with: ruby-version: "3.1" bundler: latest diff --git a/.github/workflows/release-request-weekly.yml b/.github/workflows/release-request-weekly.yml index 47140b6f5..4267f0007 100644 --- a/.github/workflows/release-request-weekly.yml +++ b/.github/workflows/release-request-weekly.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.214.0 + uses: ruby/setup-ruby@v1.215.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-request.yml b/.github/workflows/release-request.yml index 89c5a6fc5..76d74c928 100644 --- a/.github/workflows/release-request.yml +++ b/.github/workflows/release-request.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.214.0 + uses: ruby/setup-ruby@v1.215.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo diff --git a/.github/workflows/release-retry.yml b/.github/workflows/release-retry.yml index 3f403396c..ae20f2774 100644 --- a/.github/workflows/release-retry.yml +++ b/.github/workflows/release-retry.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Ruby ${{ env.ruby_version }} - uses: ruby/setup-ruby@v1.214.0 + uses: ruby/setup-ruby@v1.215.0 with: ruby-version: ${{ env.ruby_version }} - name: Checkout repo From 1fc69498640c8a7d1fc0eb7deba507ba77dc5a5c Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Fri, 31 Jan 2025 14:56:56 -0600 Subject: [PATCH 17/20] ci: Add Ruby 3.4 build (#1347) * ci: Add Ruby 3.4 build * squash: use a separate cache key * Revert "squash: use a separate cache key" This reverts commit 78cb4d2ccb491dc4895ad64ab3ff719e35b4ded4. * squash: copy paste error * squash: 3.4 workaround * squash: mas cosas * squash: relax test * squash: fix test * squash: why you no work? * squash: more dependencies * squash: damage * stop commiting after midnight * squash: tricky compatability * squash: aws test fix? --- .github/workflows/ci-contrib.yml | 20 +++++++++++++ .../ci-instrumentation-with-services.yml | 30 +++++++++++++++++++ .github/workflows/ci-instrumentation.yml | 5 ++++ helpers/mysql/Gemfile | 7 +++++ helpers/sql-obfuscation/Gemfile | 7 +++++ helpers/sql/Gemfile | 7 +++++ instrumentation/CONTRIBUTING.md | 5 ++++ instrumentation/action_mailer/Gemfile | 4 +++ instrumentation/action_pack/Gemfile | 4 +++ instrumentation/action_view/Gemfile | 4 +++ instrumentation/active_job/Gemfile | 4 +++ .../active_model_serializers/Gemfile | 4 +++ instrumentation/active_record/Gemfile | 4 +++ instrumentation/active_storage/Gemfile | 4 +++ instrumentation/active_support/Gemfile | 4 +++ instrumentation/all/Gemfile | 5 ++++ instrumentation/aws_lambda/Gemfile | 4 +++ .../opentelemetry/instrumentation_test.rb | 3 +- instrumentation/aws_sdk/Gemfile | 4 +++ instrumentation/base/Gemfile | 7 +++++ instrumentation/bunny/Gemfile | 4 +++ instrumentation/concurrent_ruby/Gemfile | 4 +++ instrumentation/dalli/Gemfile | 4 +++ instrumentation/delayed_job/Gemfile | 4 +++ instrumentation/ethon/Gemfile | 4 +++ instrumentation/excon/Gemfile | 4 +++ instrumentation/faraday/Gemfile | 4 +++ instrumentation/grape/Gemfile | 4 +++ instrumentation/graphql/Appraisals | 30 ++++++------------- instrumentation/graphql/Gemfile | 4 +++ .../graphql/instrumentation_test.rb | 4 +-- instrumentation/grpc/Gemfile | 4 +++ instrumentation/gruf/Gemfile | 4 +++ instrumentation/http/Gemfile | 4 +++ instrumentation/http_client/Gemfile | 4 +++ instrumentation/httpx/Gemfile | 4 +++ instrumentation/koala/Gemfile | 4 +++ instrumentation/lmdb/Gemfile | 4 +++ instrumentation/mongo/Gemfile | 8 ++++- instrumentation/mysql2/Gemfile | 5 ++++ instrumentation/net_http/Gemfile | 4 +++ instrumentation/pg/Gemfile | 4 +++ instrumentation/que/Gemfile | 4 +++ instrumentation/racecar/Gemfile | 6 +++- instrumentation/rack/Gemfile | 4 +++ instrumentation/rails/Gemfile | 5 ++++ .../rails/test/railtie/test_helper.rb | 1 + instrumentation/rake/Gemfile | 4 +++ instrumentation/rdkafka/Gemfile | 4 +++ instrumentation/redis/Gemfile | 4 +++ instrumentation/resque/Gemfile | 4 +++ instrumentation/restclient/Gemfile | 4 +++ instrumentation/rspec/Gemfile | 4 +++ instrumentation/ruby_kafka/Gemfile | 5 ++++ instrumentation/sidekiq/Gemfile | 4 +++ instrumentation/sinatra/Gemfile | 4 +++ instrumentation/trilogy/Gemfile | 5 ++++ processor/baggage/Gemfile | 7 +++++ propagator/ottrace/Gemfile | 7 +++++ propagator/vitess/Gemfile | 7 +++++ propagator/xray/Gemfile | 7 +++++ resources/azure/Gemfile | 4 +++ resources/container/Gemfile | 4 +++ resources/google_cloud_platform/Gemfile | 4 +++ 64 files changed, 330 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci-contrib.yml b/.github/workflows/ci-contrib.yml index 1f0d0c65a..59b88e9dd 100644 --- a/.github/workflows/ci-contrib.yml +++ b/.github/workflows/ci-contrib.yml @@ -30,6 +30,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-helpers-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: @@ -70,6 +75,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-propagator-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: @@ -109,6 +119,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: @@ -147,6 +162,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-processor-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: diff --git a/.github/workflows/ci-instrumentation-with-services.yml b/.github/workflows/ci-instrumentation-with-services.yml index e30123ae7..15e3d974f 100644 --- a/.github/workflows/ci-instrumentation-with-services.yml +++ b/.github/workflows/ci-instrumentation-with-services.yml @@ -29,6 +29,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: @@ -76,6 +81,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: @@ -114,6 +124,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: @@ -168,6 +183,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: @@ -213,6 +233,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: @@ -255,6 +280,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: diff --git a/.github/workflows/ci-instrumentation.yml b/.github/workflows/ci-instrumentation.yml index 491fd6e32..841e14115 100644 --- a/.github/workflows/ci-instrumentation.yml +++ b/.github/workflows/ci-instrumentation.yml @@ -60,6 +60,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: diff --git a/helpers/mysql/Gemfile b/helpers/mysql/Gemfile index f649e2f64..afb6912bf 100644 --- a/helpers/mysql/Gemfile +++ b/helpers/mysql/Gemfile @@ -7,3 +7,10 @@ source 'https://rubygems.org' gemspec + +group :test do + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end +end diff --git a/helpers/sql-obfuscation/Gemfile b/helpers/sql-obfuscation/Gemfile index f649e2f64..afb6912bf 100644 --- a/helpers/sql-obfuscation/Gemfile +++ b/helpers/sql-obfuscation/Gemfile @@ -7,3 +7,10 @@ source 'https://rubygems.org' gemspec + +group :test do + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end +end diff --git a/helpers/sql/Gemfile b/helpers/sql/Gemfile index 5f1d771fa..5139c3d9a 100644 --- a/helpers/sql/Gemfile +++ b/helpers/sql/Gemfile @@ -11,3 +11,10 @@ source 'https://rubygems.org' # then target specific versions in the Appraisals file. gemspec + +group :test do + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end +end diff --git a/instrumentation/CONTRIBUTING.md b/instrumentation/CONTRIBUTING.md index 36269d89d..9a77d6d7a 100644 --- a/instrumentation/CONTRIBUTING.md +++ b/instrumentation/CONTRIBUTING.md @@ -353,6 +353,11 @@ If we determine the service container slows down the test suite significantly, i runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-helpers-${{ matrix.gem }}" + ruby: "3.4" - name: "Test Ruby 3.3" uses: ./.github/actions/test_gem with: diff --git a/instrumentation/action_mailer/Gemfile b/instrumentation/action_mailer/Gemfile index c0f09e6f4..39ff49aac 100644 --- a/instrumentation/action_mailer/Gemfile +++ b/instrumentation/action_mailer/Gemfile @@ -14,4 +14,8 @@ group :test do # Add jar-dependencies gem only if the Ruby runtime is JRuby # https://github.com/jruby/jruby/issues/7262 gem 'jar-dependencies', '0.4.1', platforms: :jruby + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/action_pack/Gemfile b/instrumentation/action_pack/Gemfile index 1ff5cee48..167e8562f 100644 --- a/instrumentation/action_pack/Gemfile +++ b/instrumentation/action_pack/Gemfile @@ -12,4 +12,8 @@ group :test do gem 'opentelemetry-instrumentation-base', path: '../../instrumentation/base' gem 'opentelemetry-instrumentation-rack', path: '../../instrumentation/rack' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/action_view/Gemfile b/instrumentation/action_view/Gemfile index 54506a58d..362b810fa 100644 --- a/instrumentation/action_view/Gemfile +++ b/instrumentation/action_view/Gemfile @@ -12,4 +12,8 @@ group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-instrumentation-active_support', path: '../active_support' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/active_job/Gemfile b/instrumentation/active_job/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/active_job/Gemfile +++ b/instrumentation/active_job/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/active_model_serializers/Gemfile b/instrumentation/active_model_serializers/Gemfile index 2ededff74..e4d2581d4 100644 --- a/instrumentation/active_model_serializers/Gemfile +++ b/instrumentation/active_model_serializers/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-instrumentation-active_support', path: '../active_support' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/active_record/Gemfile b/instrumentation/active_record/Gemfile index 02f64ca9a..5d3d05e15 100644 --- a/instrumentation/active_record/Gemfile +++ b/instrumentation/active_record/Gemfile @@ -12,4 +12,8 @@ group :test do gem 'byebug' gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/active_storage/Gemfile b/instrumentation/active_storage/Gemfile index 2ededff74..e4d2581d4 100644 --- a/instrumentation/active_storage/Gemfile +++ b/instrumentation/active_storage/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-instrumentation-active_support', path: '../active_support' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/active_support/Gemfile b/instrumentation/active_support/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/active_support/Gemfile +++ b/instrumentation/active_support/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/all/Gemfile b/instrumentation/all/Gemfile index 30808d503..2142f3e97 100644 --- a/instrumentation/all/Gemfile +++ b/instrumentation/all/Gemfile @@ -9,6 +9,11 @@ source 'https://rubygems.org' gemspec group :test do + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end + Dir.entries('../../helpers') .select { |entry| File.directory?(File.join('../../helpers', entry)) } .reject { |entry| %w[. ..].include?(entry) } # rubocop:disable Performance/CollectionLiteralInLoop diff --git a/instrumentation/aws_lambda/Gemfile b/instrumentation/aws_lambda/Gemfile index a03fdb17e..9fe40be08 100644 --- a/instrumentation/aws_lambda/Gemfile +++ b/instrumentation/aws_lambda/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'webrick', '~> 1.7' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb b/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb index 648a4ad62..928419ac4 100644 --- a/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb +++ b/instrumentation/aws_lambda/test/opentelemetry/instrumentation_test.rb @@ -96,8 +96,7 @@ _(last_span.hex_span_id.size).must_equal 16 _(last_span.hex_trace_id.size).must_equal 32 _(last_span.trace_flags.sampled?).must_equal true - - assert_equal last_span.tracestate, { 'otel' => 'ff40ea9699e62af2-01' } + _(last_span.tracestate.to_h).must_equal({ 'otel' => 'ff40ea9699e62af2-01' }) end event_v1['headers'].delete('traceparent') event_v1['headers'].delete('tracestate') diff --git a/instrumentation/aws_sdk/Gemfile b/instrumentation/aws_sdk/Gemfile index a03fdb17e..9fe40be08 100644 --- a/instrumentation/aws_sdk/Gemfile +++ b/instrumentation/aws_sdk/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'webrick', '~> 1.7' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/base/Gemfile b/instrumentation/base/Gemfile index f649e2f64..afb6912bf 100644 --- a/instrumentation/base/Gemfile +++ b/instrumentation/base/Gemfile @@ -7,3 +7,10 @@ source 'https://rubygems.org' gemspec + +group :test do + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end +end diff --git a/instrumentation/bunny/Gemfile b/instrumentation/bunny/Gemfile index 5b7d54b64..3b0bc1bdf 100644 --- a/instrumentation/bunny/Gemfile +++ b/instrumentation/bunny/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/concurrent_ruby/Gemfile b/instrumentation/concurrent_ruby/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/concurrent_ruby/Gemfile +++ b/instrumentation/concurrent_ruby/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/dalli/Gemfile b/instrumentation/dalli/Gemfile index 036a87b29..a3267745c 100644 --- a/instrumentation/dalli/Gemfile +++ b/instrumentation/dalli/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/delayed_job/Gemfile b/instrumentation/delayed_job/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/delayed_job/Gemfile +++ b/instrumentation/delayed_job/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/ethon/Gemfile b/instrumentation/ethon/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/ethon/Gemfile +++ b/instrumentation/ethon/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/excon/Gemfile b/instrumentation/excon/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/excon/Gemfile +++ b/instrumentation/excon/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/faraday/Gemfile b/instrumentation/faraday/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/faraday/Gemfile +++ b/instrumentation/faraday/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/grape/Gemfile b/instrumentation/grape/Gemfile index a97f3cccf..b9575b527 100644 --- a/instrumentation/grape/Gemfile +++ b/instrumentation/grape/Gemfile @@ -16,4 +16,8 @@ group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-instrumentation-rack', path: '../rack' gem 'builder' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/graphql/Appraisals b/instrumentation/graphql/Appraisals index 05298c160..52d9a9dd6 100644 --- a/instrumentation/graphql/Appraisals +++ b/instrumentation/graphql/Appraisals @@ -4,33 +4,21 @@ # # SPDX-License-Identifier: Apache-2.0 -# Max compatible version of 1.x -appraise 'graphql-1.x' do - gem 'graphql', '~> 1.13' -end - -# A bug was introduced in 2.0.18 that was fixed in 2.0.19 -appraise 'graphql-2.0.18' do - gem 'graphql', '2.0.18' -end - # Max compatible version of 2.0.x -appraise 'graphql-2.0' do - gem 'graphql', '~> 2.0.27' -end -# Max compatible version of 2.1.x -appraise 'graphql-2.1' do - gem 'graphql', '~> 2.1.8' +(0..4).each do |minor_version| + appraise "graphql-2.#{minor_version}.x" do + gem 'graphql', "~> 2.#{minor_version}.0" + end end -appraise 'graphql-c_parser-2.2.x' do - gem 'graphql', '~> 2.2.1' - gem 'graphql-c_parser', '~> 1.0.7' +appraise 'graphql-c_parser-1.0.x' do + gem 'graphql', '< 2.3.1' + gem 'graphql-c_parser', '~> 1.0.0' end -appraise 'graphql-2.2.x' do - gem 'graphql', '~> 2.2.1', '< 3.0.0' +appraise 'graphql-c_parser-1.x' do + gem 'graphql-c_parser', '~> 1.1' end appraise 'graphql-c_parser-latest' do diff --git a/instrumentation/graphql/Gemfile b/instrumentation/graphql/Gemfile index 5b7d54b64..3b0bc1bdf 100644 --- a/instrumentation/graphql/Gemfile +++ b/instrumentation/graphql/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/graphql/test/instrumentation/graphql/instrumentation_test.rb b/instrumentation/graphql/test/instrumentation/graphql/instrumentation_test.rb index 580918fb8..70e8c04a3 100644 --- a/instrumentation/graphql/test/instrumentation/graphql/instrumentation_test.rb +++ b/instrumentation/graphql/test/instrumentation/graphql/instrumentation_test.rb @@ -54,7 +54,7 @@ OpenTelemetry::TestHelpers.with_test_logger do |log| instrumentation.install(config) _(log.string).must_match( - /undefined method `trace_with'.*Old::Truck/ + /undefined method.*trace_with.*Old::Truck/ ) end end @@ -90,7 +90,7 @@ instrumentation.install(config) _(log.string).must_match( - /undefined method `use'.*Old::Truck/ + /undefined method.*use.*Old::Truck/ ) end end diff --git a/instrumentation/grpc/Gemfile b/instrumentation/grpc/Gemfile index 68f476d47..f87d40ffb 100644 --- a/instrumentation/grpc/Gemfile +++ b/instrumentation/grpc/Gemfile @@ -12,4 +12,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/gruf/Gemfile b/instrumentation/gruf/Gemfile index a952c5002..208227775 100644 --- a/instrumentation/gruf/Gemfile +++ b/instrumentation/gruf/Gemfile @@ -14,4 +14,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/http/Gemfile b/instrumentation/http/Gemfile index 5b7d54b64..3b0bc1bdf 100644 --- a/instrumentation/http/Gemfile +++ b/instrumentation/http/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/http_client/Gemfile b/instrumentation/http_client/Gemfile index 5b7d54b64..3b0bc1bdf 100644 --- a/instrumentation/http_client/Gemfile +++ b/instrumentation/http_client/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/httpx/Gemfile b/instrumentation/httpx/Gemfile index 8b038cdcb..88f25d67e 100644 --- a/instrumentation/httpx/Gemfile +++ b/instrumentation/httpx/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug', platform: 'ruby' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/koala/Gemfile b/instrumentation/koala/Gemfile index 5b7d54b64..3b0bc1bdf 100644 --- a/instrumentation/koala/Gemfile +++ b/instrumentation/koala/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/lmdb/Gemfile b/instrumentation/lmdb/Gemfile index 5b7d54b64..3b0bc1bdf 100644 --- a/instrumentation/lmdb/Gemfile +++ b/instrumentation/lmdb/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/mongo/Gemfile b/instrumentation/mongo/Gemfile index 4c6082de3..cb4d0e9ba 100644 --- a/instrumentation/mongo/Gemfile +++ b/instrumentation/mongo/Gemfile @@ -8,4 +8,10 @@ source 'https://rubygems.org' gemspec -gem 'opentelemetry-instrumentation-base', path: '../base' +group :test do + gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end +end diff --git a/instrumentation/mysql2/Gemfile b/instrumentation/mysql2/Gemfile index fc50ea311..7d8ac2815 100644 --- a/instrumentation/mysql2/Gemfile +++ b/instrumentation/mysql2/Gemfile @@ -13,4 +13,9 @@ group :test, :development do gem 'opentelemetry-helpers-sql', path: '../../helpers/sql' gem 'opentelemetry-helpers-mysql', path: '../../helpers/mysql' gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'bigdecimal' + gem 'mutex_m' + end end diff --git a/instrumentation/net_http/Gemfile b/instrumentation/net_http/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/net_http/Gemfile +++ b/instrumentation/net_http/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/pg/Gemfile b/instrumentation/pg/Gemfile index a298585bb..393fb9ce5 100644 --- a/instrumentation/pg/Gemfile +++ b/instrumentation/pg/Gemfile @@ -13,4 +13,8 @@ group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-helpers-sql', path: '../../helpers/sql' gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/que/Gemfile b/instrumentation/que/Gemfile index 9a673d3a2..098ad1b91 100644 --- a/instrumentation/que/Gemfile +++ b/instrumentation/que/Gemfile @@ -15,4 +15,8 @@ group :test do gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation' gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-instrumentation-pg', path: '../pg' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/racecar/Gemfile b/instrumentation/racecar/Gemfile index b4aa971cf..8b4e6610d 100644 --- a/instrumentation/racecar/Gemfile +++ b/instrumentation/racecar/Gemfile @@ -13,6 +13,10 @@ source 'https://rubygems.org' gemspec group :development, :test do - gem 'activesupport', '~> 6' # used to test against JRuby which is only MRI 2.6 compatibile + gem 'activesupport' gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/rack/Gemfile b/instrumentation/rack/Gemfile index c8b2ad72f..cb6872035 100644 --- a/instrumentation/rack/Gemfile +++ b/instrumentation/rack/Gemfile @@ -12,4 +12,8 @@ group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'rack-test', '~> 2.1.0' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/rails/Gemfile b/instrumentation/rails/Gemfile index 117177e6e..73b3d2188 100644 --- a/instrumentation/rails/Gemfile +++ b/instrumentation/rails/Gemfile @@ -19,4 +19,9 @@ group :test, :development do gem 'opentelemetry-instrumentation-active_support', path: '../active_support' gem 'opentelemetry-instrumentation-action_view', path: '../action_view' gem 'opentelemetry-instrumentation-rack', path: '../rack' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'drb' + gem 'mutex_m' + end end diff --git a/instrumentation/rails/test/railtie/test_helper.rb b/instrumentation/rails/test/railtie/test_helper.rb index 47fc82f4e..d33691ce3 100644 --- a/instrumentation/rails/test/railtie/test_helper.rb +++ b/instrumentation/rails/test/railtie/test_helper.rb @@ -13,6 +13,7 @@ require 'bundler/setup' Bundler.require(:default, :development, :test) +require 'drb' require_relative '../../test/railtie/dummy/config/environment' require 'rails/test_help' diff --git a/instrumentation/rake/Gemfile b/instrumentation/rake/Gemfile index a952c5002..208227775 100644 --- a/instrumentation/rake/Gemfile +++ b/instrumentation/rake/Gemfile @@ -14,4 +14,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/rdkafka/Gemfile b/instrumentation/rdkafka/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/rdkafka/Gemfile +++ b/instrumentation/rdkafka/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/redis/Gemfile b/instrumentation/redis/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/redis/Gemfile +++ b/instrumentation/redis/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/resque/Gemfile b/instrumentation/resque/Gemfile index a340f69a9..370add599 100644 --- a/instrumentation/resque/Gemfile +++ b/instrumentation/resque/Gemfile @@ -12,4 +12,8 @@ group :test do gem 'activejob' gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/restclient/Gemfile b/instrumentation/restclient/Gemfile index 2baf57ac4..cb4d0e9ba 100644 --- a/instrumentation/restclient/Gemfile +++ b/instrumentation/restclient/Gemfile @@ -10,4 +10,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/rspec/Gemfile b/instrumentation/rspec/Gemfile index 74a39f083..1f471f53b 100644 --- a/instrumentation/rspec/Gemfile +++ b/instrumentation/rspec/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'rspec', '~> 3.0' gem 'opentelemetry-instrumentation-base', path: '../base' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/ruby_kafka/Gemfile b/instrumentation/ruby_kafka/Gemfile index 5b7d54b64..19acd43ac 100644 --- a/instrumentation/ruby_kafka/Gemfile +++ b/instrumentation/ruby_kafka/Gemfile @@ -11,4 +11,9 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'bigdecimal' + gem 'mutex_m' + end end diff --git a/instrumentation/sidekiq/Gemfile b/instrumentation/sidekiq/Gemfile index 84efc8a18..4eaed0573 100644 --- a/instrumentation/sidekiq/Gemfile +++ b/instrumentation/sidekiq/Gemfile @@ -12,4 +12,8 @@ group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-instrumentation-redis', path: '../redis' gem 'pry-byebug' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/sinatra/Gemfile b/instrumentation/sinatra/Gemfile index a8bfa13a1..979b4b8d5 100644 --- a/instrumentation/sinatra/Gemfile +++ b/instrumentation/sinatra/Gemfile @@ -11,4 +11,8 @@ gemspec group :test do gem 'opentelemetry-instrumentation-base', path: '../base' gem 'opentelemetry-instrumentation-rack', path: '../rack' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/instrumentation/trilogy/Gemfile b/instrumentation/trilogy/Gemfile index 2484ca993..94ce08991 100644 --- a/instrumentation/trilogy/Gemfile +++ b/instrumentation/trilogy/Gemfile @@ -14,4 +14,9 @@ group :test do gem 'opentelemetry-helpers-sql', path: '../../helpers/sql' gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation' gem 'opentelemetry-propagator-vitess', path: '../../propagator/vitess' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'bigdecimal' + gem 'mutex_m' + end end diff --git a/processor/baggage/Gemfile b/processor/baggage/Gemfile index 52eb0ed2e..60fea68d1 100644 --- a/processor/baggage/Gemfile +++ b/processor/baggage/Gemfile @@ -4,3 +4,10 @@ source 'https://rubygems.org' # Specify your gem's dependencies in opentelemetry-processor-baggage.gemspec gemspec + +group :test do + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end +end diff --git a/propagator/ottrace/Gemfile b/propagator/ottrace/Gemfile index 12150b151..f90da05eb 100644 --- a/propagator/ottrace/Gemfile +++ b/propagator/ottrace/Gemfile @@ -4,3 +4,10 @@ source 'https://rubygems.org' # Specify your gem's dependencies in opentelemetry-propragator-ottrace.gemspec gemspec + +group :test do + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end +end diff --git a/propagator/vitess/Gemfile b/propagator/vitess/Gemfile index b79007ade..4e5d0180b 100644 --- a/propagator/vitess/Gemfile +++ b/propagator/vitess/Gemfile @@ -4,3 +4,10 @@ source 'https://rubygems.org' # Specify your gem's dependencies in opentelemetry-propragator-vitess.gemspec gemspec + +group :test do + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end +end diff --git a/propagator/xray/Gemfile b/propagator/xray/Gemfile index b32179c8b..894ba545f 100644 --- a/propagator/xray/Gemfile +++ b/propagator/xray/Gemfile @@ -7,3 +7,10 @@ source 'https://rubygems.org' gemspec + +group :test do + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end +end diff --git a/resources/azure/Gemfile b/resources/azure/Gemfile index 6ae9e48bc..4e5a19cc9 100644 --- a/resources/azure/Gemfile +++ b/resources/azure/Gemfile @@ -11,4 +11,8 @@ gemspec group :development, :test do gem 'byebug' unless RUBY_PLATFORM == 'java' gem 'pry' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/resources/container/Gemfile b/resources/container/Gemfile index 6ae9e48bc..4e5a19cc9 100644 --- a/resources/container/Gemfile +++ b/resources/container/Gemfile @@ -11,4 +11,8 @@ gemspec group :development, :test do gem 'byebug' unless RUBY_PLATFORM == 'java' gem 'pry' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end diff --git a/resources/google_cloud_platform/Gemfile b/resources/google_cloud_platform/Gemfile index 6ae9e48bc..4e5a19cc9 100644 --- a/resources/google_cloud_platform/Gemfile +++ b/resources/google_cloud_platform/Gemfile @@ -11,4 +11,8 @@ gemspec group :development, :test do gem 'byebug' unless RUBY_PLATFORM == 'java' gem 'pry' + if RUBY_VERSION >= '3.4' + gem 'base64' + gem 'mutex_m' + end end From 79492915fad7222ee9b81f66c18a8e177927bb94 Mon Sep 17 00:00:00 2001 From: "Y.Matsuda" <44557218+ymtdzzz@users.noreply.github.com> Date: Tue, 4 Feb 2025 03:53:12 +0900 Subject: [PATCH 18/20] feat: add active_storage instrumentation to `rails` (#1391) feat: add active_storage instrumentation to rails (and implicitly to all) --- instrumentation/rails/Gemfile | 1 + instrumentation/rails/lib/opentelemetry/instrumentation/rails.rb | 1 + .../rails/opentelemetry-instrumentation-rails.gemspec | 1 + 3 files changed, 3 insertions(+) diff --git a/instrumentation/rails/Gemfile b/instrumentation/rails/Gemfile index 73b3d2188..4344f49e4 100644 --- a/instrumentation/rails/Gemfile +++ b/instrumentation/rails/Gemfile @@ -17,6 +17,7 @@ group :test, :development do gem 'opentelemetry-instrumentation-action_pack', path: '../action_pack' gem 'opentelemetry-instrumentation-active_record', path: '../active_record' gem 'opentelemetry-instrumentation-active_support', path: '../active_support' + gem 'opentelemetry-instrumentation-active_storage', path: '../active_storage' gem 'opentelemetry-instrumentation-action_view', path: '../action_view' gem 'opentelemetry-instrumentation-rack', path: '../rack' if RUBY_VERSION >= '3.4' diff --git a/instrumentation/rails/lib/opentelemetry/instrumentation/rails.rb b/instrumentation/rails/lib/opentelemetry/instrumentation/rails.rb index 2893aba0c..8c8d6e4f8 100644 --- a/instrumentation/rails/lib/opentelemetry/instrumentation/rails.rb +++ b/instrumentation/rails/lib/opentelemetry/instrumentation/rails.rb @@ -20,6 +20,7 @@ module Rails require 'opentelemetry-instrumentation-action_view' require 'opentelemetry-instrumentation-action_mailer' require 'opentelemetry-instrumentation-active_record' +require 'opentelemetry-instrumentation-active_storage' require 'opentelemetry-instrumentation-active_job' require 'opentelemetry-instrumentation-concurrent_ruby' require_relative 'rails/instrumentation' diff --git a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec index 6f6bd5a4f..3b0fedbd3 100644 --- a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec +++ b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec @@ -31,6 +31,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-instrumentation-action_view', '~> 0.9.0' spec.add_dependency 'opentelemetry-instrumentation-active_job', '~> 0.8.0' spec.add_dependency 'opentelemetry-instrumentation-active_record', '~> 0.9.0' + spec.add_dependency 'opentelemetry-instrumentation-active_storage', '~> 0.1.0' spec.add_dependency 'opentelemetry-instrumentation-active_support', '~> 0.8.0' spec.add_dependency 'opentelemetry-instrumentation-base', '~> 0.23.0' spec.add_dependency 'opentelemetry-instrumentation-concurrent_ruby', '~> 0.22.0' From 02823b3b969c9dc1ed5ee4e5ebdb9ce86590810f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 20:55:25 +0000 Subject: [PATCH 19/20] release: Release 5 gems (#1394) * release: Release 5 gems * opentelemetry-instrumentation-all 0.73.0 (was 0.72.0) * opentelemetry-instrumentation-redis 0.26.1 (was 0.26.0) * opentelemetry-instrumentation-rails 0.36.0 (was 0.35.1) * opentelemetry-instrumentation-aws_lambda 0.3.0 (was 0.2.0) * opentelemetry-instrumentation-action_pack 0.12.0 (was 0.11.0) * squash: Update instrumentation/all/CHANGELOG.md * squash: Fix Spelling Error * chore: Bump versions in rails and all gemspecs * chore: Changelog updates --------- Co-authored-by: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Co-authored-by: Ariel Valentin Co-authored-by: Kayla Reopelle --- instrumentation/action_pack/CHANGELOG.md | 4 ++++ .../opentelemetry/instrumentation/action_pack/version.rb | 2 +- instrumentation/all/CHANGELOG.md | 7 +++++++ .../all/lib/opentelemetry/instrumentation/all/version.rb | 2 +- .../all/opentelemetry-instrumentation-all.gemspec | 6 +++--- instrumentation/aws_lambda/CHANGELOG.md | 5 +++++ .../opentelemetry/instrumentation/aws_lambda/version.rb | 2 +- instrumentation/rails/CHANGELOG.md | 5 +++++ .../lib/opentelemetry/instrumentation/rails/version.rb | 2 +- .../rails/opentelemetry-instrumentation-rails.gemspec | 2 +- instrumentation/redis/CHANGELOG.md | 4 ++++ .../lib/opentelemetry/instrumentation/redis/version.rb | 2 +- 12 files changed, 34 insertions(+), 9 deletions(-) diff --git a/instrumentation/action_pack/CHANGELOG.md b/instrumentation/action_pack/CHANGELOG.md index 4aa83d1d0..3eff08eb9 100644 --- a/instrumentation/action_pack/CHANGELOG.md +++ b/instrumentation/action_pack/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-action_pack +### v0.12.0 / 2025-02-04 + +* ADDED: Strip Rails `(.:format)` suffix from `http.route` + ### v0.11.0 / 2025-01-16 * BREAKING CHANGE: Drop Support for EoL Rails 6.1 diff --git a/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/version.rb b/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/version.rb index fd49e4f58..57cb47a9a 100644 --- a/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/version.rb +++ b/instrumentation/action_pack/lib/opentelemetry/instrumentation/action_pack/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module ActionPack - VERSION = '0.11.0' + VERSION = '0.12.0' end end end diff --git a/instrumentation/all/CHANGELOG.md b/instrumentation/all/CHANGELOG.md index 8ed41fe20..856ebf5e2 100644 --- a/instrumentation/all/CHANGELOG.md +++ b/instrumentation/all/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History: opentelemetry-instrumentation-all +### v0.73.0 / 2025-02-04 + +* CHANGED: opentelemetry-instrumentation-redis v0.26.1 +* CHANGED: opentelemetry-instrumentation-rails v0.36.0 +* CHANGED: opentelemetry-instrumentation-aws_lambda v0.3.0 +* CHANGED: opentelemetry-instrumentation-action_pack v0.12.0 + ### v0.72.0 / 2025-01-16 * BREAKING CHANGE: Set minimum supported version to Ruby 3.1 diff --git a/instrumentation/all/lib/opentelemetry/instrumentation/all/version.rb b/instrumentation/all/lib/opentelemetry/instrumentation/all/version.rb index 7d189a99d..f8e7e77f8 100644 --- a/instrumentation/all/lib/opentelemetry/instrumentation/all/version.rb +++ b/instrumentation/all/lib/opentelemetry/instrumentation/all/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module All - VERSION = '0.72.0' + VERSION = '0.73.0' end end end diff --git a/instrumentation/all/opentelemetry-instrumentation-all.gemspec b/instrumentation/all/opentelemetry-instrumentation-all.gemspec index 53b6b65c2..fea50bef3 100644 --- a/instrumentation/all/opentelemetry-instrumentation-all.gemspec +++ b/instrumentation/all/opentelemetry-instrumentation-all.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 3.1' spec.add_dependency 'opentelemetry-instrumentation-active_model_serializers', '~> 0.22.0' - spec.add_dependency 'opentelemetry-instrumentation-aws_lambda', '~> 0.2.0' + spec.add_dependency 'opentelemetry-instrumentation-aws_lambda', '~> 0.3.0' spec.add_dependency 'opentelemetry-instrumentation-aws_sdk', '~> 0.8.0' spec.add_dependency 'opentelemetry-instrumentation-bunny', '~> 0.22.0' spec.add_dependency 'opentelemetry-instrumentation-concurrent_ruby', '~> 0.22.0' @@ -50,10 +50,10 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-instrumentation-que', '~> 0.9.0' spec.add_dependency 'opentelemetry-instrumentation-racecar', '~> 0.4.0' spec.add_dependency 'opentelemetry-instrumentation-rack', '~> 0.26.0' - spec.add_dependency 'opentelemetry-instrumentation-rails', '~> 0.35.0' + spec.add_dependency 'opentelemetry-instrumentation-rails', '~> 0.36.0' spec.add_dependency 'opentelemetry-instrumentation-rake', '~> 0.3.0' spec.add_dependency 'opentelemetry-instrumentation-rdkafka', '~> 0.5.0' - spec.add_dependency 'opentelemetry-instrumentation-redis', '~> 0.26.0' + spec.add_dependency 'opentelemetry-instrumentation-redis', '~> 0.26.1' spec.add_dependency 'opentelemetry-instrumentation-resque', '~> 0.6.0' spec.add_dependency 'opentelemetry-instrumentation-restclient', '~> 0.23.0' spec.add_dependency 'opentelemetry-instrumentation-ruby_kafka', '~> 0.22.0' diff --git a/instrumentation/aws_lambda/CHANGELOG.md b/instrumentation/aws_lambda/CHANGELOG.md index 7616c42ca..466d72fb6 100644 --- a/instrumentation/aws_lambda/CHANGELOG.md +++ b/instrumentation/aws_lambda/CHANGELOG.md @@ -1,5 +1,10 @@ # Release History: opentelemetry-instrumentation-aws_lambda +### v0.3.0 / 2025-02-04 + +* ADDED: AWS Lambda programmatic wrap +* FIXED: AWS Lambda test fix + ### v0.2.0 / 2025-01-16 * BREAKING CHANGE: Set minimum supported version to Ruby 3.1 diff --git a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb index f7a2b2657..f8a9ac1a7 100644 --- a/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb +++ b/instrumentation/aws_lambda/lib/opentelemetry/instrumentation/aws_lambda/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module AwsLambda - VERSION = '0.2.0' + VERSION = '0.3.0' end end end diff --git a/instrumentation/rails/CHANGELOG.md b/instrumentation/rails/CHANGELOG.md index 92044321e..16341beb6 100644 --- a/instrumentation/rails/CHANGELOG.md +++ b/instrumentation/rails/CHANGELOG.md @@ -1,5 +1,10 @@ # Release History: opentelemetry-instrumentation-rails +### v0.36.0 / 2025-02-04 + +* ADDED: Add active_storage instrumentation to `rails` +* ADDED: Strip Rails `(.:format)` suffix from `http.route` (action_pack) + ### v0.35.1 / 2025-01-28 * DOCS: Required version in Rails README from 0.24 to 0.34. diff --git a/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb b/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb index c876b9ead..1f28eb7c0 100644 --- a/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb +++ b/instrumentation/rails/lib/opentelemetry/instrumentation/rails/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Rails - VERSION = '0.35.1' + VERSION = '0.36.0' end end end diff --git a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec index 3b0fedbd3..7ed7af287 100644 --- a/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec +++ b/instrumentation/rails/opentelemetry-instrumentation-rails.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'opentelemetry-api', '~> 1.0' spec.add_dependency 'opentelemetry-instrumentation-action_mailer', '~> 0.4.0' - spec.add_dependency 'opentelemetry-instrumentation-action_pack', '~> 0.11.0' + spec.add_dependency 'opentelemetry-instrumentation-action_pack', '~> 0.12.0' spec.add_dependency 'opentelemetry-instrumentation-action_view', '~> 0.9.0' spec.add_dependency 'opentelemetry-instrumentation-active_job', '~> 0.8.0' spec.add_dependency 'opentelemetry-instrumentation-active_record', '~> 0.9.0' diff --git a/instrumentation/redis/CHANGELOG.md b/instrumentation/redis/CHANGELOG.md index 8c3d3019e..d0375d65f 100644 --- a/instrumentation/redis/CHANGELOG.md +++ b/instrumentation/redis/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History: opentelemetry-instrumentation-redis +### v0.26.1 / 2025-02-04 + +* FIXED: Do not expose auth params with Redis 5 + ### v0.26.0 / 2025-01-16 * BREAKING CHANGE: Set minimum supported version to Ruby 3.1 diff --git a/instrumentation/redis/lib/opentelemetry/instrumentation/redis/version.rb b/instrumentation/redis/lib/opentelemetry/instrumentation/redis/version.rb index e971778a7..50b86a614 100644 --- a/instrumentation/redis/lib/opentelemetry/instrumentation/redis/version.rb +++ b/instrumentation/redis/lib/opentelemetry/instrumentation/redis/version.rb @@ -7,7 +7,7 @@ module OpenTelemetry module Instrumentation module Redis - VERSION = '0.26.0' + VERSION = '0.26.1' end end end From 8ca4fc6f44e652ceeb6fefc0504c3043bb177997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ka=C5=BAmierczak?= Date: Tue, 4 Feb 2025 23:08:57 +0100 Subject: [PATCH 20/20] feat: add gRPC trace demonstration (#1376) * feat: add gRPC trace demonstration * Rubocop, exclude 'example/proto/*.rb' --- instrumentation/grpc/.rubocop.yml | 1 + instrumentation/grpc/example/example_impl.rb | 11 ++++++ .../grpc/example/proto/example_api.proto | 16 +++++++++ .../grpc/example/proto/example_api_pb.rb | 18 ++++++++++ .../example/proto/example_api_services_pb.rb | 23 ++++++++++++ .../grpc/example/trace_demonstration.rb | 35 +++++++++++++++++++ 6 files changed, 104 insertions(+) create mode 100644 instrumentation/grpc/example/example_impl.rb create mode 100644 instrumentation/grpc/example/proto/example_api.proto create mode 100644 instrumentation/grpc/example/proto/example_api_pb.rb create mode 100644 instrumentation/grpc/example/proto/example_api_services_pb.rb create mode 100644 instrumentation/grpc/example/trace_demonstration.rb diff --git a/instrumentation/grpc/.rubocop.yml b/instrumentation/grpc/.rubocop.yml index 3dad77a56..4326990f6 100644 --- a/instrumentation/grpc/.rubocop.yml +++ b/instrumentation/grpc/.rubocop.yml @@ -3,3 +3,4 @@ inherit_from: ../../.rubocop.yml AllCops: Exclude: - 'test/support/proto/*.rb' + - 'example/proto/*.rb' diff --git a/instrumentation/grpc/example/example_impl.rb b/instrumentation/grpc/example/example_impl.rb new file mode 100644 index 000000000..74faf8ec3 --- /dev/null +++ b/instrumentation/grpc/example/example_impl.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +# Copyright The OpenTelemetry Authors +# +# SPDX-License-Identifier: Apache-2.0 + +class ExampleImpl < ::Proto::Example::ExampleAPI::Service + def example(_req, _call) + Proto::Example::ExampleResponse.new(response_name: 'Hello') + end +end diff --git a/instrumentation/grpc/example/proto/example_api.proto b/instrumentation/grpc/example/proto/example_api.proto new file mode 100644 index 000000000..d753c86de --- /dev/null +++ b/instrumentation/grpc/example/proto/example_api.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package proto.example; + +service ExampleAPI { + rpc Example(ExampleRequest) returns (ExampleResponse); +} + +message ExampleRequest { + uint64 id = 1; + string name = 2; +} + +message ExampleResponse { + string response_name = 1; +} diff --git a/instrumentation/grpc/example/proto/example_api_pb.rb b/instrumentation/grpc/example/proto/example_api_pb.rb new file mode 100644 index 000000000..91e486192 --- /dev/null +++ b/instrumentation/grpc/example/proto/example_api_pb.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/example_api.proto + +require 'google/protobuf' + +descriptor_data = "\n\x17proto/example_api.proto\x12\rproto.example\"*\n\x0e\x45xampleRequest\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x0c\n\x04name\x18\x02 \x01(\t\"(\n\x0f\x45xampleResponse\x12\x15\n\rresponse_name\x18\x01 \x01(\t2V\n\nExampleAPI\x12H\n\x07\x45xample\x12\x1d.proto.example.ExampleRequest\x1a\x1e.proto.example.ExampleResponseb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Proto + module Example + ExampleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('proto.example.ExampleRequest').msgclass + ExampleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup('proto.example.ExampleResponse').msgclass + end +end diff --git a/instrumentation/grpc/example/proto/example_api_services_pb.rb b/instrumentation/grpc/example/proto/example_api_services_pb.rb new file mode 100644 index 000000000..78ba281b2 --- /dev/null +++ b/instrumentation/grpc/example/proto/example_api_services_pb.rb @@ -0,0 +1,23 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: proto/example_api.proto for package 'proto.example' + +require 'grpc' +require_relative 'example_api_pb' + +module Proto + module Example + module ExampleAPI + class Service + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'proto.example.ExampleAPI' + + rpc :Example, ::Proto::Example::ExampleRequest, ::Proto::Example::ExampleResponse + end + + Stub = Service.rpc_stub_class + end + end +end diff --git a/instrumentation/grpc/example/trace_demonstration.rb b/instrumentation/grpc/example/trace_demonstration.rb new file mode 100644 index 000000000..479ca1142 --- /dev/null +++ b/instrumentation/grpc/example/trace_demonstration.rb @@ -0,0 +1,35 @@ +require_relative './proto/example_api_services_pb' +require_relative './example_impl' + +require 'bundler/inline' + +gemfile do + source 'https://rubygems.org' + gem 'grpc' + gem 'opentelemetry-api' + gem 'opentelemetry-common' + gem 'opentelemetry-instrumentation-grpc', path: '../' + gem 'opentelemetry-sdk' +end + +ENV['OTEL_TRACES_EXPORTER'] = 'console' +OpenTelemetry::SDK.configure do |c| + c.use 'OpenTelemetry::Instrumentation::Grpc' +end + + +# start the server +@service = ExampleImpl.new +server = GRPC::RpcServer.new(pool_size: 1, poll_period: 1) +server_port = server.add_http2_port('localhost:0', :this_port_is_insecure) +server.handle(ExampleImpl) +server_thread = Thread.new { server.run } +server.wait_till_running + + +# make a request +stub = Proto::Example::ExampleAPI::Stub.new("localhost:#{server_port}", :this_channel_is_insecure) +stub.example(Proto::Example::ExampleRequest.new(id: 1, name: 'test!')) + +server.stop +server_thread.join