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
use LinkedTo rather than ChildOf for PublicEndpoint (#272)
This causes us to no longer emit missing root spans if we do not have the trace associated with the tracing headers we receive on public endpoints.
This commit is contained in:
@ -103,6 +103,7 @@ type SpanOption func(*SpanOptions)
|
||||
type SpanOptions struct {
|
||||
Attributes []core.KeyValue
|
||||
StartTime time.Time
|
||||
Links []Link
|
||||
Relation Relation
|
||||
Record bool
|
||||
SpanKind SpanKind
|
||||
@ -197,6 +198,13 @@ func FollowsFrom(sc core.SpanContext) SpanOption {
|
||||
}
|
||||
}
|
||||
|
||||
// LinkedTo allows instantiating a Span with initial Links.
|
||||
func LinkedTo(sc core.SpanContext, attrs ...core.KeyValue) SpanOption {
|
||||
return func(o *SpanOptions) {
|
||||
o.Links = append(o.Links, Link{sc, attrs})
|
||||
}
|
||||
}
|
||||
|
||||
// WithSpanKind specifies the role a Span on a Trace.
|
||||
func WithSpanKind(sk SpanKind) SpanOption {
|
||||
return func(o *SpanOptions) {
|
||||
|
Reference in New Issue
Block a user