Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove Metrics OTLP exporter Util#measure_request_duration and duplicate files #1717

Merged
merged 5 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def send_bytes(bytes, timeout:)
@http.read_timeout = remaining_timeout
@http.write_timeout = remaining_timeout
@http.start unless @http.started?
response = measure_request_duration { @http.request(request) }
response = @http.request(request)
case response
when Net::HTTPOK
response.body # Read and discard body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Exporter
module OTLP
module Metrics
# Util module provide essential functionality for exporter
module Util # rubocop:disable Metrics/ModuleLength
module Util
KEEP_ALIVE_TIMEOUT = 30
RETRY_COUNT = 5
ERROR_MESSAGE_INVALID_HEADERS = 'headers must be a String with comma-separated URL Encoded UTF-8 k=v pairs or a Hash'
Expand Down Expand Up @@ -67,16 +67,6 @@ def prepare_headers(config_headers)
headers
end

def measure_request_duration
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
begin
yield
ensure
stop = Process.clock_gettime(Process::CLOCK_MONOTONIC)
1000.0 * (stop - start)
end
end

def parse_headers(raw)
entries = raw.split(',')
raise ArgumentError, ERROR_MESSAGE_INVALID_HEADERS if entries.empty?
Expand Down

This file was deleted.

Loading
Loading