Skip to content

Commit

Permalink
Honor user input
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Jan 13, 2025
1 parent 64038d0 commit 90d6886
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Fix error logged by Jaeger remote sampler on empty or unset `OTEL_TRACES_SAMPLER_ARG` environment variable (#6511)
- Relax minimum Go version to 1.22.0 in various modules. (#6595)
- `NewSDK` handles `OpenTelemetryConfiguration.Resource` in `go.opentelemetry.io/contrib/config/v0.3.0` properly. (#6606)
- `NewSDK` handles `OpenTelemetryConfiguration.Resource` properly in `go.opentelemetry.io/contrib/config/v0.3.0`. (#6606)

<!-- Released section -->
<!-- Don't change this section unless doing release -->
Expand Down
3 changes: 1 addition & 2 deletions config/v0.3.0/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ func keyVal(k string, v any) attribute.KeyValue {
}

func newResource(res *Resource) *resource.Resource {
if res == nil ||
res.SchemaUrl == nil && res.Attributes == nil && res.AttributesList == nil && res.Detectors == nil {
if res == nil {
return resource.Default()
}

Expand Down
2 changes: 1 addition & 1 deletion config/v0.3.0/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestNewResource(t *testing.T) {
{
name: "resource-no-attributes",
config: &Resource{},
wantResource: resource.Default(),
wantResource: resource.NewSchemaless(),
},
{
name: "resource-with-schema",
Expand Down

0 comments on commit 90d6886

Please sign in to comment.