@@ -155,22 +155,22 @@ func TestMerge(t *testing.T) {
155155 },
156156 {
157157 name : "Merge with first resource with schema" ,
158- a : resource .NewWithAttributes ("https://opentelemetry.io/schemas/1.4 .0" , kv41 ),
158+ a : resource .NewWithAttributes ("https://opentelemetry.io/schemas/1.21 .0" , kv41 ),
159159 b : resource .NewSchemaless (kv42 ),
160160 want : []attribute.KeyValue {kv42 },
161- schemaURL : "https://opentelemetry.io/schemas/1.4 .0" ,
161+ schemaURL : "https://opentelemetry.io/schemas/1.21 .0" ,
162162 },
163163 {
164164 name : "Merge with second resource with schema" ,
165165 a : resource .NewSchemaless (kv41 ),
166- b : resource .NewWithAttributes ("https://opentelemetry.io/schemas/1.4 .0" , kv42 ),
166+ b : resource .NewWithAttributes ("https://opentelemetry.io/schemas/1.21 .0" , kv42 ),
167167 want : []attribute.KeyValue {kv42 },
168- schemaURL : "https://opentelemetry.io/schemas/1.4 .0" ,
168+ schemaURL : "https://opentelemetry.io/schemas/1.21 .0" ,
169169 },
170170 {
171171 name : "Merge with different schemas" ,
172- a : resource .NewWithAttributes ("https://opentelemetry.io/schemas/1.4 .0" , kv41 ),
173- b : resource .NewWithAttributes ("https://opentelemetry.io/schemas/1.3 .0" , kv42 ),
172+ a : resource .NewWithAttributes ("https://opentelemetry.io/schemas/1.21 .0" , kv41 ),
173+ b : resource .NewWithAttributes ("https://opentelemetry.io/schemas/1.20 .0" , kv42 ),
174174 want : []attribute.KeyValue {kv42 },
175175 isErr : true ,
176176 },
@@ -378,21 +378,25 @@ func TestNew(t *testing.T) {
378378 envars : "" ,
379379 options : []resource.Option {
380380 resource .WithAttributes (attribute .String ("A" , "B" )),
381- resource .WithSchemaURL ("https://opentelemetry.io/schemas/1.0 .0" ),
381+ resource .WithSchemaURL ("https://opentelemetry.io/schemas/1.21 .0" ),
382382 },
383383 resourceValues : map [string ]string {
384384 "A" : "B" ,
385385 },
386- schemaURL : "https://opentelemetry.io/schemas/1.0 .0" ,
386+ schemaURL : "https://opentelemetry.io/schemas/1.21 .0" ,
387387 },
388388 {
389389 name : "With conflicting schema urls" ,
390390 envars : "" ,
391391 options : []resource.Option {
392392 resource .WithDetectors (
393- resource .StringDetector ("https://opentelemetry.io/schemas/1.0.0" , semconv .HostNameKey , os .Hostname ),
393+ resource .StringDetector (
394+ "https://opentelemetry.io/schemas/1.20.0" ,
395+ semconv .HostNameKey ,
396+ os .Hostname ,
397+ ),
394398 ),
395- resource .WithSchemaURL ("https://opentelemetry.io/schemas/1.1 .0" ),
399+ resource .WithSchemaURL ("https://opentelemetry.io/schemas/1.21 .0" ),
396400 },
397401 resourceValues : map [string ]string {
398402 string (semconv .HostNameKey ): func () (hostname string ) {
@@ -408,14 +412,18 @@ func TestNew(t *testing.T) {
408412 envars : "" ,
409413 options : []resource.Option {
410414 resource .WithDetectors (
411- resource .StringDetector ("https://opentelemetry.io/schemas/1.0.0" , semconv .HostNameKey , os .Hostname ),
412415 resource .StringDetector (
413- "https://opentelemetry.io/schemas/1.1.0" ,
416+ "https://opentelemetry.io/schemas/1.19.0" ,
417+ semconv .HostNameKey ,
418+ os .Hostname ,
419+ ),
420+ resource .StringDetector (
421+ "https://opentelemetry.io/schemas/1.20.0" ,
414422 semconv .HostNameKey ,
415423 func () (string , error ) { return "" , errors .New ("fail" ) },
416424 ),
417425 ),
418- resource .WithSchemaURL ("https://opentelemetry.io/schemas/1.2 .0" ),
426+ resource .WithSchemaURL ("https://opentelemetry.io/schemas/1.21 .0" ),
419427 },
420428 resourceValues : map [string ]string {
421429 string (semconv .HostNameKey ): func () (hostname string ) {
@@ -791,7 +799,7 @@ type fakeDetector struct{}
791799func (f fakeDetector ) Detect (_ context.Context ) (* resource.Resource , error ) {
792800 // A bit pedantic, but resource.NewWithAttributes returns an empty Resource when
793801 // no attributes specified. We want to make sure that this is concurrent-safe.
794- return resource .NewWithAttributes ("https://opentelemetry.io/schemas/1.3 .0" ), nil
802+ return resource .NewWithAttributes ("https://opentelemetry.io/schemas/1.21 .0" ), nil
795803}
796804
797805var _ resource.Detector = & fakeDetector {}
0 commit comments