File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 88
99 "go.opentelemetry.io/otel"
1010 "go.opentelemetry.io/otel/sdk/resource"
11- semconv "go.opentelemetry.io/otel/semconv/v1.21 .0"
11+ semconv "go.opentelemetry.io/otel/semconv/v1.26 .0"
1212)
1313
1414var (
Original file line number Diff line number Diff line change 1+ package detect
2+
3+ import (
4+ "testing"
5+
6+ "github.com/stretchr/testify/require"
7+ "go.opentelemetry.io/otel"
8+ )
9+
10+ func TestResource (t * testing.T ) {
11+ prevHandler := otel .GetErrorHandler ()
12+ t .Cleanup (func () {
13+ otel .SetErrorHandler (prevHandler )
14+ })
15+
16+ var resourceErr error
17+ otel .SetErrorHandler (otel .ErrorHandlerFunc (func (err error ) {
18+ resourceErr = err
19+ }))
20+
21+ res := Resource ()
22+
23+ // Should not have an empty schema url. Only happens when
24+ // there is a schema conflict.
25+ require .NotEqual (t , "" , res .SchemaURL ())
26+
27+ // No error should have been invoked.
28+ require .NoError (t , resourceErr )
29+ }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import (
1111 "go.opentelemetry.io/otel/attribute"
1212 "go.opentelemetry.io/otel/codes"
1313 "go.opentelemetry.io/otel/propagation"
14- semconv "go.opentelemetry.io/otel/semconv/v1.21 .0"
14+ semconv "go.opentelemetry.io/otel/semconv/v1.26 .0"
1515 "go.opentelemetry.io/otel/trace"
1616 "go.opentelemetry.io/otel/trace/noop"
1717
You can’t perform that action at this time.
0 commit comments