You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-15 01:04:25 +02:00
change trace.WithAttributes to append values instead of replacing (#315)
* change trace.WithAttributes to append values instead of replacing * improve doc
This commit is contained in:
committed by
Liz Fong-Jones
parent
a228bafec5
commit
1fd93b293c
@ -204,9 +204,10 @@ func WithStartTime(t time.Time) SpanOption {
|
||||
|
||||
// WithAttributes sets attributes to span. These attributes provides additional
|
||||
// data about the span.
|
||||
// Multiple `WithAttributes` options appends the attributes preserving the order.
|
||||
func WithAttributes(attrs ...core.KeyValue) SpanOption {
|
||||
return func(o *SpanOptions) {
|
||||
o.Attributes = attrs
|
||||
o.Attributes = append(o.Attributes, attrs...)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user