Skip to content

Commit 2bf81b5

Browse files
committed
squash: preserve broken ethon gem
1 parent d33f60a commit 2bf81b5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

instrumentation/ethon/lib/opentelemetry/instrumentation/ethon/http_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def self.span_attrs_for(method, semconv: :stable)
7474
)
7575
else
7676
SpanCreationAttributes.new(
77-
span_name: 'HTTP',
77+
span_name: semconv == :old ? 'HTTP N/A' : 'HTTP',
7878
normalized_method: '_OTHER',
7979
original_method: method.to_s
8080
)

instrumentation/ethon/test/opentelemetry/instrumentation/ethon/old/instrumentation_test.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
easy.stub(:complete, nil) do
7070
easy.perform
7171

72-
_(span.name).must_equal 'HTTP'
72+
_(span.name).must_equal 'HTTP N/A'
7373
_(span.attributes['http.method']).must_equal '_OTHER'
7474
_(span.attributes['http.status_code']).must_be_nil
7575
_(span.attributes['http.url']).must_equal 'http://example.com/test'
@@ -87,7 +87,7 @@
8787

8888
# NOTE: check the finished spans since we expect to have closed it
8989
span = exporter.finished_spans.first
90-
_(span.name).must_equal 'HTTP'
90+
_(span.name).must_equal 'HTTP N/A'
9191
_(span.attributes['http.method']).must_equal '_OTHER'
9292
_(span.attributes['http.status_code']).must_be_nil
9393
_(span.attributes['http.url']).must_equal 'http://example.com/test'
@@ -113,7 +113,7 @@ def stub_response(options)
113113

114114
it 'when response is successful' do
115115
stub_response(response_code: 200) do
116-
_(span.name).must_equal 'HTTP'
116+
_(span.name).must_equal 'HTTP N/A'
117117
_(span.attributes['http.method']).must_equal '_OTHER'
118118
_(span.attributes['http.status_code']).must_equal 200
119119
_(span.attributes['http.url']).must_equal 'http://example.com/test'
@@ -126,7 +126,7 @@ def stub_response(options)
126126

127127
it 'when response is not successful' do
128128
stub_response(response_code: 500) do
129-
_(span.name).must_equal 'HTTP'
129+
_(span.name).must_equal 'HTTP N/A'
130130
_(span.attributes['http.method']).must_equal '_OTHER'
131131
_(span.attributes['http.status_code']).must_equal 500
132132
_(span.attributes['http.url']).must_equal 'http://example.com/test'
@@ -139,9 +139,9 @@ def stub_response(options)
139139

140140
it 'when request times out' do
141141
stub_response(response_code: 0, return_code: :operation_timedout) do
142-
_(span.name).must_equal 'HTTP'
142+
_(span.name).must_equal 'HTTP N/A'
143143
_(span.attributes['http.method']).must_equal '_OTHER'
144-
_(span.attributes['http.status_code']).must_be_nil
144+
_(span.attributes['http.status_code']).must_equal 0
145145
_(span.attributes['http.url']).must_equal 'http://example.com/test'
146146
_(span.status.code).must_equal(
147147
OpenTelemetry::Trace::Status::ERROR
@@ -255,7 +255,7 @@ def stub_response(options)
255255

256256
stub_response(response_code: 200) do
257257
_(exporter.finished_spans.size).must_equal 1
258-
_(span.name).must_equal 'HTTP'
258+
_(span.name).must_equal 'HTTP N/A'
259259
_(span.attributes['http.method']).must_equal '_OTHER'
260260
_(span.attributes['http.url']).must_equal 'http://example.com/purge'
261261
end

0 commit comments

Comments
 (0)