Skip to content

Commit

Permalink
refactor: Fix rubocop ruby linter failures
Browse files Browse the repository at this point in the history
Reviewed-by: kaylareopelle
Refs: open-telemetry#1172
  • Loading branch information
Victorsesan committed Nov 17, 2024
1 parent 194e6f9 commit 6b07cb5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Easy
HTTP_METHODS_TO_SPAN_NAMES = Hash.new { |h, k| h[k] = "HTTP #{k}" }

# Constant for the HTTP status range
HTTP_STATUS_SUCCESS_RANGE = (100..399).freeze
HTTP_STATUS_SUCCESS_RANGE = (100..399)

def http_request(url, action_name, options = {})
@otel_method = ACTION_NAMES_TO_HTTP_METHODS[action_name]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0
Expand All @@ -21,7 +22,7 @@ class TracerMiddleware < ::Excon::Middleware::Base
end.freeze

# Constant for the HTTP status range
HTTP_STATUS_SUCCESS_RANGE = (100..399).freeze
HTTP_STATUS_SUCCESS_RANGE = (100..399)

def request_call(datum)
return @stack.request_call(datum) if untraced?(datum)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TracerMiddleware < ::Faraday::Middleware
}.freeze

# Constant for the HTTP status range
HTTP_STATUS_SUCCESS_RANGE = (100..399).freeze
HTTP_STATUS_SUCCESS_RANGE = (100..399)

def call(env)
http_method = HTTP_METHODS_SYMBOL_TO_STRING[env.method]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Patches
# Module to prepend to HTTP::Client for instrumentation
module Client
# Constant for the HTTP status range
HTTP_STATUS_SUCCESS_RANGE = (100..399).freeze
HTTP_STATUS_SUCCESS_RANGE = (100..399)

def perform(req, options)
uri = req.uri
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Plugin
# an OTEL trace.
class RequestTracer
# Constant for the HTTP status range
HTTP_STATUS_SUCCESS_RANGE = (100..399).freeze
HTTP_STATUS_SUCCESS_RANGE = (100..399)

def initialize(request)
@request = request
Expand Down Expand Up @@ -92,4 +92,4 @@ def send(request)
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Instrumentation
USE_SSL_TO_SCHEME = { false => 'http', true => 'https' }.freeze

# Constant for the HTTP status range
HTTP_STATUS_SUCCESS_RANGE = (100..399).freeze
HTTP_STATUS_SUCCESS_RANGE = (100..399)

def request(req, body = nil, &block)
# Do not trace recursive call for starting the connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Patches
# Module to prepend to RestClient::Request for instrumentation
module Request
# Constant for the HTTP status range
HTTP_STATUS_SUCCESS_RANGE = (100..399).freeze
HTTP_STATUS_SUCCESS_RANGE = (100..399)

def execute(&block)
trace_request do |_span|
Expand Down

0 comments on commit 6b07cb5

Please sign in to comment.