From ff7c61eef40c44e575f600d752943cfa709826f1 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Fri, 31 Jan 2025 23:25:26 -0600 Subject: [PATCH 01/14] refactor: Use Block Argument Forwading > This cop identifies places where do_something(&block) can be replaced by do_something(&) https://docs.rubocop.org/rubocop/cops_style.html#styleargumentsforwarding https://docs.rubocop.org/rubocop/cops_naming.html#namingblockforwarding --- .rubocop.yml | 6 ------ .../opentelemetry/instrumentation/bunny/patch_helpers.rb | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index bbacb1955a..86a04083f3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -38,12 +38,6 @@ Metrics/PerceivedComplexity: Naming/FileName: Exclude: - '**/opentelemetry-*' -### TODO: Enable this is a separate PR -Naming/BlockForwarding: - Enabled: false -Style/ArgumentsForwarding: - Enabled: false -####################### Style/Documentation: Exclude: - "**/test/**/*" diff --git a/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/patch_helpers.rb b/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/patch_helpers.rb index 043a175699..fe79e9a4ba 100644 --- a/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/patch_helpers.rb +++ b/instrumentation/bunny/lib/opentelemetry/instrumentation/bunny/patch_helpers.rb @@ -12,11 +12,11 @@ module Bunny # For additional details around trace messaging semantics # See https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#messaging-attributes module PatchHelpers - def self.with_send_span(channel, tracer, exchange, routing_key, &block) + def self.with_send_span(channel, tracer, exchange, routing_key, &) attributes = basic_attributes(channel, channel.connection, exchange, routing_key) destination = destination_name(exchange, routing_key) - tracer.in_span("#{destination} publish", attributes: attributes, kind: :producer, &block) + tracer.in_span("#{destination} publish", attributes: attributes, kind: :producer, &) end def self.with_process_span(channel, tracer, delivery_info, properties, &block) From 8255d595d5563a08c505a2a6314b1012cd31101e Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Sat, 1 Feb 2025 08:01:51 -0600 Subject: [PATCH 02/14] squash: update que --- .../instrumentation/que/middlewares/server_middleware.rb | 2 +- .../lib/opentelemetry/instrumentation/que/patches/que_job.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/que/lib/opentelemetry/instrumentation/que/middlewares/server_middleware.rb b/instrumentation/que/lib/opentelemetry/instrumentation/que/middlewares/server_middleware.rb index 386a6d5cd1..bb9cfae494 100644 --- a/instrumentation/que/lib/opentelemetry/instrumentation/que/middlewares/server_middleware.rb +++ b/instrumentation/que/lib/opentelemetry/instrumentation/que/middlewares/server_middleware.rb @@ -10,7 +10,7 @@ module Que module Middlewares # Server middleware to trace Que jobs class ServerMiddleware - def self.call(job, &block) + def self.call(job, &) job_class = job_class(job) span_name = "#{job_class} process" attributes = attributes_before_job_completion(job, job_class) diff --git a/instrumentation/que/lib/opentelemetry/instrumentation/que/patches/que_job.rb b/instrumentation/que/lib/opentelemetry/instrumentation/que/patches/que_job.rb index a189f5aee9..e50a0994d1 100644 --- a/instrumentation/que/lib/opentelemetry/instrumentation/que/patches/que_job.rb +++ b/instrumentation/que/lib/opentelemetry/instrumentation/que/patches/que_job.rb @@ -62,7 +62,7 @@ def gem_version end if Gem.loaded_specs['que'].version >= Gem::Version.new('2.1.0') - def bulk_enqueue(**_kwargs, &block) + def bulk_enqueue(**_kwargs, &) tracer = Que::Instrumentation.instance.tracer otel_config = Que::Instrumentation.instance.config From 43112a34f0768c6a2f8a2f305867bc2a0456e1b3 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Sat, 1 Feb 2025 08:02:46 -0600 Subject: [PATCH 03/14] squash: action mailer --- .../instrumentation/action_mailer/subscription_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instrumentation/action_mailer/test/opentelemetry/instrumentation/action_mailer/subscription_test.rb b/instrumentation/action_mailer/test/opentelemetry/instrumentation/action_mailer/subscription_test.rb index 2d22098c6f..9ba4e1151a 100644 --- a/instrumentation/action_mailer/test/opentelemetry/instrumentation/action_mailer/subscription_test.rb +++ b/instrumentation/action_mailer/test/opentelemetry/instrumentation/action_mailer/subscription_test.rb @@ -116,7 +116,7 @@ end end - def with_configuration(values, &block) + def with_configuration(values, &) original_config = instrumentation.instance_variable_get(:@config) modified_config = original_config.merge(values) instrumentation.instance_variable_set(:@config, modified_config) @@ -126,14 +126,14 @@ def with_configuration(values, &block) instrumentation.instance_variable_set(:@config, original_config) end - def subscribing_to_deliver(&block) + def subscribing_to_deliver(&) subscription = OpenTelemetry::Instrumentation::ActionMailer::Railtie.subscribe_to_deliver yield ensure ActiveSupport::Notifications.unsubscribe(subscription) end - def subscribing_to_process(&block) + def subscribing_to_process(&) subscription = OpenTelemetry::Instrumentation::ActionMailer::Railtie.subscribe_to_process yield ensure From c1e0caa6f6f048cf3ff62fdb5a9f7ce62206759b Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Sat, 1 Feb 2025 08:09:27 -0600 Subject: [PATCH 04/14] squash: active record --- .../active_record/patches/persistence.rb | 30 +++++++++---------- .../patches/persistence_class_methods.rb | 10 +++---- .../persistence_insert_class_methods.rb | 12 ++++---- .../patches/relation_persistence.rb | 4 +-- .../patches/transactions_class_methods.rb | 2 +- .../active_record/patches/validations.rb | 4 +-- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence.rb b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence.rb index ef57c2d068..9552bf7b23 100644 --- a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence.rb +++ b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence.rb @@ -29,91 +29,91 @@ def destroy! end end - def becomes(klass) + def becomes(...) tracer.in_span("#{self.class}#becomes") do super end end - def becomes!(klass) + def becomes!(...) tracer.in_span("#{self.class}#becomes!") do super end end - def update_attribute(name, value) + def update_attribute(...) tracer.in_span("#{self.class}#update_attribute") do super end end - def update(attributes) + def update(...) tracer.in_span("#{self.class}#update") do super end end - def update!(attributes) + def update!(...) tracer.in_span("#{self.class}#update!") do super end end - def update_column(name, value) + def update_column(...) tracer.in_span("#{self.class}#update_column") do super end end - def update_columns(attributes) + def update_columns(...) tracer.in_span("#{self.class}#update_columns") do super end end - def increment(attribute, by = 1) + def increment(...) tracer.in_span("#{self.class}#increment") do super end end - def increment!(attribute, by = 1, touch: nil) + def increment!(...) tracer.in_span("#{self.class}#increment!") do super end end - def decrement(attribute, by = 1) + def decrement(...) tracer.in_span("#{self.class}#decrement") do super end end - def decrement!(attribute, by = 1, touch: nil) + def decrement!(...) tracer.in_span("#{self.class}#decrement!") do super end end - def toggle(attribute) + def toggle(...) tracer.in_span("#{self.class}#toggle") do super end end - def toggle!(attribute) + def toggle!(...) tracer.in_span("#{self.class}#toggle!") do super end end - def reload(options = nil) + def reload(...) tracer.in_span("#{self.class}#reload") do super end end - def touch(*names, time: nil) + def touch(...) tracer.in_span("#{self.class}#touch") do super end diff --git a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence_class_methods.rb b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence_class_methods.rb index f29b9d316c..1e82193ba6 100644 --- a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence_class_methods.rb +++ b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence_class_methods.rb @@ -18,31 +18,31 @@ class << base # Contains ActiveRecord::Persistence::ClassMethods to be patched module ClassMethods - def create(attributes = nil, &block) + def create(...) tracer.in_span("#{self}.create") do super end end - def create!(attributes = nil, &block) + def create!(...) tracer.in_span("#{self}.create!") do super end end - def update(id = :all, attributes) # rubocop:disable Style/OptionalArguments + def update(...) tracer.in_span("#{self}.update") do super end end - def destroy(id) + def destroy(...) tracer.in_span("#{self}.destroy") do super end end - def delete(id_or_array) + def delete(...) tracer.in_span("#{self}.delete") do super end diff --git a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence_insert_class_methods.rb b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence_insert_class_methods.rb index 8472feafec..5def9e5bd1 100644 --- a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence_insert_class_methods.rb +++ b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/persistence_insert_class_methods.rb @@ -18,37 +18,37 @@ class << base # Contains ActiveRecord::Persistence::ClassMethods to be patched module ClassMethods - ruby2_keywords def insert(*args) + def insert(...) tracer.in_span("#{self}.insert") do super end end - ruby2_keywords def insert_all(*args) + def insert_all(...) tracer.in_span("#{self}.insert_all") do super end end - ruby2_keywords def insert!(*args) + def insert!(...) tracer.in_span("#{self}.insert!") do super end end - ruby2_keywords def insert_all!(*args) + def insert_all!(...) tracer.in_span("#{self}.insert_all!") do super end end - ruby2_keywords def upsert(*args) + def upsert(...) tracer.in_span("#{self}.upsert") do super end end - ruby2_keywords def upsert_all(*args) + def upsert_all(...) tracer.in_span("#{self}.upsert_all") do super end diff --git a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/relation_persistence.rb b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/relation_persistence.rb index ceb445913d..46c7ee5f64 100644 --- a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/relation_persistence.rb +++ b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/relation_persistence.rb @@ -10,13 +10,13 @@ module ActiveRecord module Patches # Module to prepend to ActiveRecord::Relation for instrumentation module RelationPersistence - def update_all(*) + def update_all(...) tracer.in_span("#{model.name}.update_all") do super end end - def delete_all(*) + def delete_all(...) tracer.in_span("#{model.name}.delete_all") do super end diff --git a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/transactions_class_methods.rb b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/transactions_class_methods.rb index 542281e369..bd6e0b5b64 100644 --- a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/transactions_class_methods.rb +++ b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/transactions_class_methods.rb @@ -18,7 +18,7 @@ class << base # Contains ActiveRecord::Transactions::ClassMethods to be patched module ClassMethods - def transaction(**options, &block) + def transaction(...) tracer.in_span('ActiveRecord.transaction', attributes: { 'code.namespace' => name }) do super end diff --git a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/validations.rb b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/validations.rb index 999997734a..1c14c83a10 100644 --- a/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/validations.rb +++ b/instrumentation/active_record/lib/opentelemetry/instrumentation/active_record/patches/validations.rb @@ -14,13 +14,13 @@ module Patches # https://github.com/rails/rails/blob/v5.2.4.5/activerecord/lib/active_record/validations.rb#L42-L53 # Contains the ActiveRecord::Validations methods to be patched module Validations - def save(**options) + def save(...) tracer.in_span("#{self.class}#save") do super end end - def save!(**options) + def save!(...) tracer.in_span("#{self.class}#save!") do super end From 0d810e0601bd9a9f3ed097ebc6ee29efafc51e8f Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Sat, 1 Feb 2025 08:10:27 -0600 Subject: [PATCH 05/14] squash: active_storage --- .../instrumentation/active_storage/subscription_test.rb | 4 ++-- .../active_storage/test/test_helpers/test_previewer.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 index 07d1b34110..099a85f357 100644 --- a/instrumentation/active_storage/test/opentelemetry/instrumentation/active_storage/subscription_test.rb +++ b/instrumentation/active_storage/test/opentelemetry/instrumentation/active_storage/subscription_test.rb @@ -341,7 +341,7 @@ # 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) + def with_configuration(values, &) original_config = instrumentation.instance_variable_get(:@config) modified_config = original_config.merge(values) instrumentation.instance_variable_set(:@config, modified_config) @@ -351,7 +351,7 @@ def with_configuration(values, &block) instrumentation.instance_variable_set(:@config, original_config) end - def with_subscription(&block) + def with_subscription(&) OpenTelemetry::Instrumentation::ActiveStorage::Railtie.subscribe yield ensure diff --git a/instrumentation/active_storage/test/test_helpers/test_previewer.rb b/instrumentation/active_storage/test/test_helpers/test_previewer.rb index 5097ce01d3..2a29ecb1fd 100644 --- a/instrumentation/active_storage/test/test_helpers/test_previewer.rb +++ b/instrumentation/active_storage/test/test_helpers/test_previewer.rb @@ -22,7 +22,7 @@ def preview(**options) private - def draw_sample_image(file, &block) - draw 'echo', '"test previewer called"', &block + def draw_sample_image(file, &) + draw('echo', '"test previewer called"', &) end end From 5918705fea2bc855e97a88618ba54b07d50cddf2 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Sat, 1 Feb 2025 08:11:17 -0600 Subject: [PATCH 06/14] squash: aws-sdk --- .../opentelemetry/instrumentation/aws_sdk/patches/telemetry.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/aws_sdk/lib/opentelemetry/instrumentation/aws_sdk/patches/telemetry.rb b/instrumentation/aws_sdk/lib/opentelemetry/instrumentation/aws_sdk/patches/telemetry.rb index 31bb41c394..68c5141291 100644 --- a/instrumentation/aws_sdk/lib/opentelemetry/instrumentation/aws_sdk/patches/telemetry.rb +++ b/instrumentation/aws_sdk/lib/opentelemetry/instrumentation/aws_sdk/patches/telemetry.rb @@ -16,7 +16,7 @@ def call(context) private - def span_wrapper(context, &block) + def span_wrapper(context, &) service_id = HandlerHelper.service_id(context) client_method = HandlerHelper.client_method(service_id, context) context.tracer.in_span( From c681511a99e449725d590ef8a7f552aa2a7369e4 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Sat, 1 Feb 2025 08:19:34 -0600 Subject: [PATCH 07/14] squash: concurrent-ruby --- .../concurrent_ruby/patches/thread_pool_executor.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/concurrent_ruby/lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb b/instrumentation/concurrent_ruby/lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb index 116e59b27f..a3f822a5ca 100644 --- a/instrumentation/concurrent_ruby/lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb +++ b/instrumentation/concurrent_ruby/lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb @@ -11,11 +11,11 @@ module Patches # Concurrent::ThreadPoolExecutor patch for instrumentation module ThreadPoolExecutor # @see Concurrent::ExecutorService#post - def post(*args, **kwargs, &task) + def post(*args, **kwargs, &) context = OpenTelemetry::Context.current return super unless context - super(*args, **kwargs) do # rubocop:disable Style/SuperArguments + super do OpenTelemetry::Context.with_current(context) do yield(*args, **kwargs) end From e1f585c0eb06308d64a25b9e19cb12b478f125a3 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Sat, 1 Feb 2025 08:42:51 -0600 Subject: [PATCH 08/14] squash: delayed job --- .../instrumentation/delayed_job/plugins/tracer_plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin.rb b/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin.rb index 676f720ed3..8edb8f9e24 100644 --- a/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin.rb +++ b/instrumentation/delayed_job/lib/opentelemetry/instrumentation/delayed_job/plugins/tracer_plugin.rb @@ -13,7 +13,7 @@ module Plugins # Delayed Job plugin that instruments invoke_job and other hooks class TracerPlugin < Delayed::Plugin class << self - def instrument_enqueue(job, &block) + def instrument_enqueue(job, &) return yield(job) unless enabled? attributes = build_attributes(job) @@ -27,7 +27,7 @@ def instrument_enqueue(job, &block) end end - def instrument_invoke(job, &block) + def instrument_invoke(job, &) return yield(job) unless enabled? attributes = build_attributes(job) From 4a54242a55e92d7a019e6d8806877588d0517c71 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Mon, 3 Feb 2025 07:34:52 -0600 Subject: [PATCH 09/14] squash: http_client --- .../opentelemetry/instrumentation/http_client/patches/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/http_client/lib/opentelemetry/instrumentation/http_client/patches/client.rb b/instrumentation/http_client/lib/opentelemetry/instrumentation/http_client/patches/client.rb index 46ad72142f..d66e21b964 100644 --- a/instrumentation/http_client/lib/opentelemetry/instrumentation/http_client/patches/client.rb +++ b/instrumentation/http_client/lib/opentelemetry/instrumentation/http_client/patches/client.rb @@ -15,7 +15,7 @@ module Client private - def do_get_block(req, proxy, conn, &block) + def do_get_block(req, proxy, conn, &) uri = req.header.request_uri url = "#{uri.scheme}://#{uri.host}" request_method = req.header.request_method From adaf193eb25a812bc48057e5386d40b291afb341 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Mon, 3 Feb 2025 07:35:41 -0600 Subject: [PATCH 10/14] squash: graphql --- .../graphql/tracers/graphql_trace_test.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb b/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb index 4fb0e9d85a..7e031854d6 100644 --- a/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb +++ b/instrumentation/graphql/test/instrumentation/graphql/tracers/graphql_trace_test.rb @@ -302,32 +302,32 @@ def initialize(events:, **_options) super end - def platform_execute_field(platform_key, &block) + def platform_execute_field(platform_key, &) @events << platform_key yield end - def platform_execute_field_lazy(platform_key, &block) + def platform_execute_field_lazy(platform_key, &) @events << platform_key yield end - def platform_authorized(platform_key, &block) + def platform_authorized(platform_key, &) @events << platform_key yield end - def platform_authorized_lazy(platform_key, &block) + def platform_authorized_lazy(platform_key, &) @events << platform_key yield end - def platform_resolve_type(platform_key, &block) + def platform_resolve_type(platform_key, &) @events << platform_key yield end - def platform_resolve_type_lazy(platform_key, &block) + def platform_resolve_type_lazy(platform_key, &) @events << platform_key yield end From 4e87839705b30da8d3255520c516e8977f149a73 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Mon, 3 Feb 2025 07:36:50 -0600 Subject: [PATCH 11/14] squash: koala --- .../instrumentation/koala/patches/instrumentation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/koala/lib/opentelemetry/instrumentation/koala/patches/instrumentation.rb b/instrumentation/koala/lib/opentelemetry/instrumentation/koala/patches/instrumentation.rb index 2fc08f45b0..2279c3cecc 100644 --- a/instrumentation/koala/lib/opentelemetry/instrumentation/koala/patches/instrumentation.rb +++ b/instrumentation/koala/lib/opentelemetry/instrumentation/koala/patches/instrumentation.rb @@ -10,7 +10,7 @@ module Koala module Patches # Module to prepend to Koala::Facebook::API for instrumentation module Api - def graph_call(path, args = {}, verb = 'get', options = {}, &post_processing) + def graph_call(path, args = {}, verb = 'get', options = {}, &) OpenTelemetry::Common::HTTP::ClientContext.with_attributes('peer.service' => 'facebook', 'koala.verb' => verb, 'koala.path' => path) do super end From 34aea148a0993e14e64a9db3b80d7dabc5ad91c1 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Mon, 3 Feb 2025 07:38:04 -0600 Subject: [PATCH 12/14] squash: net_http --- .../instrumentation/net/http/patches/instrumentation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/net_http/lib/opentelemetry/instrumentation/net/http/patches/instrumentation.rb b/instrumentation/net_http/lib/opentelemetry/instrumentation/net/http/patches/instrumentation.rb index 6cdbfdb2b7..d5ed8a5923 100644 --- a/instrumentation/net_http/lib/opentelemetry/instrumentation/net/http/patches/instrumentation.rb +++ b/instrumentation/net_http/lib/opentelemetry/instrumentation/net/http/patches/instrumentation.rb @@ -17,7 +17,7 @@ module Instrumentation # Constant for the HTTP status range HTTP_STATUS_SUCCESS_RANGE = (100..399) - def request(req, body = nil, &block) + def request(req, body = nil, &) # Do not trace recursive call for starting the connection return super unless started? From 82c145cc4c2a1f9dbbe8b4ebde1ca4a90c157969 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Mon, 3 Feb 2025 07:39:11 -0600 Subject: [PATCH 13/14] squash: restclient --- .../opentelemetry/instrumentation/restclient/patches/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/restclient/lib/opentelemetry/instrumentation/restclient/patches/request.rb b/instrumentation/restclient/lib/opentelemetry/instrumentation/restclient/patches/request.rb index 1507948f7d..94b74ccfef 100644 --- a/instrumentation/restclient/lib/opentelemetry/instrumentation/restclient/patches/request.rb +++ b/instrumentation/restclient/lib/opentelemetry/instrumentation/restclient/patches/request.rb @@ -13,7 +13,7 @@ module Request # Constant for the HTTP status range HTTP_STATUS_SUCCESS_RANGE = (100..399) - def execute(&block) + def execute(&) trace_request do |_span| super end From 36df4a98d72f5370188208f0a31477f9fb028203 Mon Sep 17 00:00:00 2001 From: Ariel Valentin Date: Mon, 3 Feb 2025 07:42:13 -0600 Subject: [PATCH 14/14] squash: rspec --- instrumentation/rspec/test/rspec_patches.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/rspec/test/rspec_patches.rb b/instrumentation/rspec/test/rspec_patches.rb index c82fd69219..2286ee4af8 100644 --- a/instrumentation/rspec/test/rspec_patches.rb +++ b/instrumentation/rspec/test/rspec_patches.rb @@ -6,7 +6,7 @@ module RSpec module Core module DSL - def self.change_global_dsl(&blk) + def self.change_global_dsl(&) nil end end