diff --git a/instrumentation/http/.github-ci.yml b/instrumentation/http/.github-ci.yml deleted file mode 100644 index 5476b1aace..0000000000 --- a/instrumentation/http/.github-ci.yml +++ /dev/null @@ -1,2 +0,0 @@ -env: - minimum_coverage: 59 diff --git a/instrumentation/http/test/instrumentation/http/instrumentation_test.rb b/instrumentation/http/test/instrumentation/http/instrumentation_test.rb index a446bc993f..25a18bf141 100644 --- a/instrumentation/http/test/instrumentation/http/instrumentation_test.rb +++ b/instrumentation/http/test/instrumentation/http/instrumentation_test.rb @@ -52,6 +52,12 @@ end end + it 'returns "old" when OTEL_SEMCONV_STABILITY_OPT_IN is old' do + OpenTelemetry::TestHelpers.with_env('OTEL_SEMCONV_STABILITY_OPT_IN' => 'old') do + _(instrumentation.determine_semconv).must_equal('old') + end + end + it 'returns "stable" when OTEL_SEMCONV_STABILITY_OPT_IN is http' do OpenTelemetry::TestHelpers.with_env('OTEL_SEMCONV_STABILITY_OPT_IN' => 'http') do _(instrumentation.determine_semconv).must_equal('stable') diff --git a/instrumentation/http/test/instrumentation/http/patches/old/client_test.rb b/instrumentation/http/test/instrumentation/http/patches/old/client_test.rb index 50fa9dfda2..7f82c78014 100644 --- a/instrumentation/http/test/instrumentation/http/patches/old/client_test.rb +++ b/instrumentation/http/test/instrumentation/http/patches/old/client_test.rb @@ -54,6 +54,7 @@ _(span.attributes['http.scheme']).must_equal 'http' _(span.attributes['http.status_code']).must_equal 200 _(span.attributes['http.target']).must_equal '/success' + _(span.attributes['http.url']).must_equal 'http://example.com' _(span.attributes['net.peer.name']).must_equal 'example.com' _(span.attributes['net.peer.port']).must_equal 80 assert_requested( @@ -72,6 +73,7 @@ _(span.attributes['http.scheme']).must_equal 'http' _(span.attributes['http.status_code']).must_equal 500 _(span.attributes['http.target']).must_equal '/failure' + _(span.attributes['http.url']).must_equal 'http://example.com' _(span.attributes['net.peer.name']).must_equal 'example.com' _(span.attributes['net.peer.port']).must_equal 80 assert_requested( @@ -92,6 +94,7 @@ _(span.attributes['http.scheme']).must_equal 'https' _(span.attributes['http.status_code']).must_be_nil _(span.attributes['http.target']).must_equal '/timeout' + _(span.attributes['http.url']).must_equal 'https://example.com' _(span.attributes['net.peer.name']).must_equal 'example.com' _(span.attributes['net.peer.port']).must_equal 443 _(span.status.code).must_equal( diff --git a/instrumentation/http/test/instrumentation/http/patches/old/connection.rb b/instrumentation/http/test/instrumentation/http/patches/old/connection_test.rb similarity index 88% rename from instrumentation/http/test/instrumentation/http/patches/old/connection.rb rename to instrumentation/http/test/instrumentation/http/patches/old/connection_test.rb index 89ed18b02f..9d7cc26db8 100644 --- a/instrumentation/http/test/instrumentation/http/patches/old/connection.rb +++ b/instrumentation/http/test/instrumentation/http/patches/old/connection_test.rb @@ -17,12 +17,16 @@ before do skip unless ENV['BUNDLE_GEMFILE'].include?('old') + ENV['OTEL_SEMCONV_STABILITY_OPT_IN'] = 'old' exporter.reset instrumentation.install({}) end # Force re-install of instrumentation - after { instrumentation.instance_variable_set(:@installed, false) } + after do + ENV.delete('OTEL_SEMCONV_STABILITY_OPT_IN') + instrumentation.instance_variable_set(:@installed, false) + end describe '#connect' do it 'emits span on connect' do diff --git a/instrumentation/http/test/instrumentation/http/patches/stable/connection.rb b/instrumentation/http/test/instrumentation/http/patches/stable/connection_test.rb similarity index 100% rename from instrumentation/http/test/instrumentation/http/patches/stable/connection.rb rename to instrumentation/http/test/instrumentation/http/patches/stable/connection_test.rb