Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return conflicting schemas as part of error. #4857

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion sdk/resource/resource.go
Expand Up @@ -17,6 +17,7 @@ package resource // import "go.opentelemetry.io/otel/sdk/resource"
import (
"context"
"errors"
"fmt"
"sync"

"go.opentelemetry.io/otel"
Expand Down Expand Up @@ -177,7 +178,8 @@ func Merge(a, b *Resource) (*Resource, error) {
case a.schemaURL == b.schemaURL:
schemaURL = a.schemaURL
default:
return Empty(), errMergeConflictSchemaURL
return Empty(), fmt.Errorf("%w: %s vs %s", errMergeConflictSchemaURL,
a.schemaURL, b.schemaURL)
}

// Note: 'b' attributes will overwrite 'a' with last-value-wins in attribute.Key()
Expand Down