chore: upgrade dependencies
This commit is contained in:
15
vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
generated
vendored
15
vendor/go.opentelemetry.io/otel/sdk/resource/resource.go
generated
vendored
@@ -48,7 +48,7 @@ var errMergeConflictSchemaURL = errors.New("cannot merge resource due to conflic
|
||||
func New(ctx context.Context, opts ...Option) (*Resource, error) {
|
||||
cfg := config{}
|
||||
for _, opt := range opts {
|
||||
opt.apply(&cfg)
|
||||
cfg = opt.apply(cfg)
|
||||
}
|
||||
|
||||
resource, err := Detect(ctx, cfg.detectors...)
|
||||
@@ -109,6 +109,17 @@ func (r *Resource) String() string {
|
||||
return r.attrs.Encoded(attribute.DefaultEncoder())
|
||||
}
|
||||
|
||||
// MarshalLog is the marshaling function used by the logging system to represent this exporter.
|
||||
func (r *Resource) MarshalLog() interface{} {
|
||||
return struct {
|
||||
Attributes attribute.Set
|
||||
SchemaURL string
|
||||
}{
|
||||
Attributes: r.attrs,
|
||||
SchemaURL: r.schemaURL,
|
||||
}
|
||||
}
|
||||
|
||||
// Attributes returns a copy of attributes from the resource in a sorted order.
|
||||
// To avoid allocating a new slice, use an iterator.
|
||||
func (r *Resource) Attributes() []attribute.KeyValue {
|
||||
@@ -183,7 +194,7 @@ func Merge(a, b *Resource) (*Resource, error) {
|
||||
mi := attribute.NewMergeIterator(b.Set(), a.Set())
|
||||
combine := make([]attribute.KeyValue, 0, a.Len()+b.Len())
|
||||
for mi.Next() {
|
||||
combine = append(combine, mi.Label())
|
||||
combine = append(combine, mi.Attribute())
|
||||
}
|
||||
merged := NewWithAttributes(schemaURL, combine...)
|
||||
return merged, nil
|
||||
|
||||
Reference in New Issue
Block a user