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'
3739 expect ( span . name ) . to eq 'search'
3840 end
3941
42+ # These conventions were updated in elastic-transport 8.5, so checking for both:
43+ # db.elasticsearch.path_parts - <= 8.5
44+ # db.operation.parameter - > 8.5
45+ #
4046 it 'sets the path parts' do
4147 CLIENT . index ( index : 'myindex' , id : 1 , body : { title : 'Test' } )
42- expect ( span . attributes [ 'db.elasticsearch.path_parts.index' ] ) . to eq 'myindex'
43- expect ( span . attributes [ 'db.elasticsearch.path_parts.id' ] ) . to eq 1
48+ expect (
49+ span . attributes [ 'db.operation.parameter.index' ] ||
50+ span . attributes [ 'db.elasticsearch.path_parts.index' ]
51+ ) . to eq 'myindex'
52+ expect (
53+ span . attributes [ 'db.operation.parameter.id' ] ||
54+ span . attributes [ 'db.elasticsearch.path_parts.id' ]
55+ ) . to eq 1
4456 end
4557 end
4658 end
You can’t perform that action at this time.
0 commit comments