Skip to content

Commit ba9d06d

Browse files
style: Spacing updates
1 parent 258b587 commit ba9d06d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

instrumentation/base/lib/opentelemetry/instrumentation/base.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#
55
# SPDX-License-Identifier: Apache-2.0
66

7-
87
module OpenTelemetry
98
module Instrumentation
109
# The Base class holds all metadata and configuration for an

instrumentation/rack/lib/opentelemetry/instrumentation/rack/instrumentation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base
3232
option :use_rack_events, default: true, validate: :boolean
3333
# TODO: This option currently exclusively uses the event handler, should we support old and new Rack?
3434
option :send_metrics, default: false, validate: :boolean
35+
3536
# Temporary Helper for Sinatra and ActionPack middleware to use during installation
3637
#
3738
# @example Default usage
@@ -48,7 +49,6 @@ def middleware_args
4849
end
4950
end
5051

51-
5252
private
5353

5454
def require_dependencies

instrumentation/rack/lib/opentelemetry/instrumentation/rack/middlewares/event_handler.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ def untraced_request?(env)
158158
false
159159
end
160160

161-
162161
# https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-http.md#name
163162
#
164163
# recommendation: span.name(s) should be low-cardinality (e.g.,
@@ -281,7 +280,11 @@ def meter
281280
def http_server_request_duration_histogram
282281
return unless metrics_enabled?
283282

284-
@http_server_request_duration_histogram ||= meter.create_histogram('http.server.request.duration', unit: 's', description: 'Duration of HTTP server requests.')
283+
@http_server_request_duration_histogram ||= meter.create_histogram(
284+
'http.server.request.duration',
285+
unit: 's',
286+
description: 'Duration of HTTP server requests.'
287+
)
285288
end
286289

287290
def record_http_server_request_duration_metric(span)
@@ -290,7 +293,7 @@ def record_http_server_request_duration_metric(span)
290293
# end - start / a billion to convert nanoseconds to seconds
291294
duration = (span.end_timestamp - span.start_timestamp) / Float(10**9)
292295
# glean attributes
293-
attrs = span.attributes.select {|k, _v| HTTP_SERVER_REQUEST_DURATION_ATTRS_FROM_SPAN.include?(k) }
296+
attrs = span.attributes.select { |k, _v| HTTP_SERVER_REQUEST_DURATION_ATTRS_FROM_SPAN.include?(k) }
294297
# set error
295298
attrs['error.type'] = span.status.description if span.status.code == OpenTelemetry::Trace::Status::ERROR
296299

0 commit comments

Comments
 (0)