Skip to content

Commit 348499c

Browse files
committed
fix: udpate span name
1 parent 914e2f5 commit 348499c

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

instrumentation/ethon/lib/opentelemetry/instrumentation/ethon/patches/dup/easy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Easy
1616
# #to_s is required because user input could be symbol or string
1717
h[k] = k.to_s.upcase
1818
end
19-
HTTP_METHODS_TO_SPAN_NAMES = Hash.new { |h, k| h[k] = "HTTP #{k}" }
19+
HTTP_METHODS_TO_SPAN_NAMES = Hash.new { |h, k| h[k] = k.to_s }
2020

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

instrumentation/ethon/lib/opentelemetry/instrumentation/ethon/patches/stable/easy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Easy
1616
# #to_s is required because user input could be symbol or string
1717
h[k] = k.to_s.upcase
1818
end
19-
HTTP_METHODS_TO_SPAN_NAMES = Hash.new { |h, k| h[k] = "HTTP #{k}" }
19+
HTTP_METHODS_TO_SPAN_NAMES = Hash.new { |h, k| h[k] = k.to_s }
2020

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

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

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

73-
_(span.name).must_equal 'HTTP N/A'
73+
_(span.name).must_equal 'N/A'
7474
_(span.attributes['http.method']).must_equal 'N/A'
7575
_(span.attributes['http.status_code']).must_be_nil
7676
_(span.attributes['http.url']).must_equal 'http://example.com/test'
@@ -97,7 +97,7 @@ def stub_response(options)
9797

9898
it 'when response is successful' do
9999
stub_response(response_code: 200) do
100-
_(span.name).must_equal 'HTTP N/A'
100+
_(span.name).must_equal 'N/A'
101101
_(span.attributes['http.method']).must_equal 'N/A'
102102
_(span.attributes['http.request.method']).must_equal 'N/A'
103103
_(span.attributes['http.status_code']).must_equal 200
@@ -113,7 +113,7 @@ def stub_response(options)
113113

114114
it 'when response is not successful' do
115115
stub_response(response_code: 500) do
116-
_(span.name).must_equal 'HTTP N/A'
116+
_(span.name).must_equal 'N/A'
117117
_(span.attributes['http.method']).must_equal 'N/A'
118118
_(span.attributes['http.request.method']).must_equal 'N/A'
119119
_(span.attributes['http.status_code']).must_equal 500
@@ -129,7 +129,7 @@ def stub_response(options)
129129

130130
it 'when request times out' do
131131
stub_response(response_code: 0, return_code: :operation_timedout) do
132-
_(span.name).must_equal 'HTTP N/A'
132+
_(span.name).must_equal 'N/A'
133133
_(span.attributes['http.method']).must_equal 'N/A'
134134
_(span.attributes['http.request.method']).must_equal 'N/A'
135135
_(span.attributes['http.status_code']).must_be_nil

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

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

73-
_(span.name).must_equal 'HTTP N/A'
73+
_(span.name).must_equal 'N/A'
7474
_(span.attributes['http.request.method']).must_equal 'N/A'
7575
_(span.attributes['http.response.status_code']).must_be_nil
7676
_(span.attributes['url.full']).must_equal 'http://example.com/test'
@@ -93,7 +93,7 @@ def stub_response(options)
9393

9494
it 'when response is successful' do
9595
stub_response(response_code: 200) do
96-
_(span.name).must_equal 'HTTP N/A'
96+
_(span.name).must_equal 'N/A'
9797
_(span.attributes['http.request.method']).must_equal 'N/A'
9898
_(span.attributes['http.response.status_code']).must_equal 200
9999
_(span.attributes['url.full']).must_equal 'http://example.com/test'
@@ -106,7 +106,7 @@ def stub_response(options)
106106

107107
it 'when response is not successful' do
108108
stub_response(response_code: 500) do
109-
_(span.name).must_equal 'HTTP N/A'
109+
_(span.name).must_equal 'N/A'
110110
_(span.attributes['http.request.method']).must_equal 'N/A'
111111
_(span.attributes['http.response.status_code']).must_equal 500
112112
_(span.attributes['url.full']).must_equal 'http://example.com/test'
@@ -119,7 +119,7 @@ def stub_response(options)
119119

120120
it 'when request times out' do
121121
stub_response(response_code: 0, return_code: :operation_timedout) do
122-
_(span.name).must_equal 'HTTP N/A'
122+
_(span.name).must_equal 'N/A'
123123
_(span.attributes['http.request.method']).must_equal 'N/A'
124124
_(span.attributes['http.response.status_code']).must_be_nil
125125
_(span.attributes['url.full']).must_equal 'http://example.com/test'

0 commit comments

Comments
 (0)