File tree Expand file tree Collapse file tree
elasticsearch/spec/integration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616# under the License.
1717
1818if ENV [ 'TEST_WITH_OTEL' ] == 'true'
19- ELASTICSEARCH_URL = ENV [ 'TEST_ES_SERVER' ] || "http://localhost:#{ ( ENV [ 'PORT' ] || 9200 ) } "
19+ require 'uri'
20+
21+ ELASTICSEARCH_URL = ENV [ 'TEST_ES_SERVER' ] || "http://localhost:#{ ENV [ 'PORT' ] || 9200 } "
2022 raise URI ::InvalidURIError unless ELASTICSEARCH_URL =~ /\A #{ URI ::DEFAULT_PARSER . make_regexp } \z /
2123
2224 require 'spec_helper'
4547 expect ( span . name ) . to eq 'search'
4648 end
4749
50+ # These conventions were updated in elastic-transport 8.5, so checking for both:
51+ # db.elasticsearch.path_parts - <= 8.5
52+ # db.operation.parameter - > 8.5
53+ #
4854 it 'sets the path parts' do
4955 client . index ( index : 'myindex' , id : 1 , body : { title : 'Test' } )
50- expect ( span . attributes [ 'db.elasticsearch.path_parts.index' ] ) . to eq 'myindex'
51- expect ( span . attributes [ 'db.elasticsearch.path_parts.id' ] ) . to eq 1
56+ expect (
57+ span . attributes [ 'db.operation.parameter.index' ] ||
58+ span . attributes [ 'db.elasticsearch.path_parts.index' ]
59+ ) . to eq 'myindex'
60+ expect (
61+ span . attributes [ 'db.operation.parameter.id' ] ||
62+ span . attributes [ 'db.elasticsearch.path_parts.id' ]
63+ ) . to eq 1
5264 end
5365 end
5466 end
You can’t perform that action at this time.
0 commit comments