Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
xuan-cao-swi committed Aug 26, 2024
1 parent 23ece6b commit 3a7b0b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Exporter
module OTLP
module Metrics
# An OpenTelemetry metrics exporter that sends metrics over HTTP as Protobuf encoded OTLP ExportMetricsServiceRequest.
class MetricsExporter < ::OpenTelemetry::SDK::Metrics::Export::MetricReader # rubocop:disable Metrics/ClassLength
class MetricsExporter < ::OpenTelemetry::SDK::Metrics::Export::MetricReader
include Util

attr_reader :metric_snapshots
Expand Down Expand Up @@ -87,7 +87,7 @@ def export(metrics, timeout: nil)
end
end

def send_bytes(bytes, timeout:) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
def send_bytes(bytes, timeout:)
return FAILURE if bytes.nil?

request = Net::HTTP::Post.new(@path)
Expand Down Expand Up @@ -181,7 +181,7 @@ def send_bytes(bytes, timeout:) # rubocop:disable Metrics/CyclomaticComplexity,
@http.write_timeout = @timeout
end

def encode(metrics_data) # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity
def encode(metrics_data)
Opentelemetry::Proto::Collector::Metrics::V1::ExportMetricsServiceRequest.encode(
Opentelemetry::Proto::Collector::Metrics::V1::ExportMetricsServiceRequest.new(
resource_metrics: metrics_data
Expand Down Expand Up @@ -215,7 +215,7 @@ def encode(metrics_data) # rubocop:disable Metrics/MethodLength, Metrics/Cycloma
# current metric sdk only implements instrument: :counter -> :sum, :histogram -> :histogram
#
# metrics [MetricData]
def as_otlp_metrics(metrics) # rubocop:disable Metrics/MethodLength
def as_otlp_metrics(metrics)
case metrics.instrument_kind
when :observable_gauge
Opentelemetry::Proto::Metrics::V1::Metric.new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def parse_headers(raw)
end
end

def backoff?(retry_count:, reason:, retry_after: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def backoff?(retry_count:, reason:, retry_after: nil)
return false if retry_count > RETRY_COUNT

sleep_interval = nil
Expand Down

0 comments on commit 3a7b0b8

Please sign in to comment.