mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2024-12-20 19:52:56 +02:00
Add documentation for tracer.Start() (#1864)
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
This commit is contained in:
parent
2bd4840c30
commit
08f4c2707f
@ -638,7 +638,19 @@ func (sk SpanKind) String() string {
|
||||
|
||||
// Tracer is the creator of Spans.
|
||||
type Tracer interface {
|
||||
// Start creates a span.
|
||||
// Start creates a span and a context.Context containing the newly-created span.
|
||||
//
|
||||
// If the context.Context provided in `ctx` contains a Span then the newly-created
|
||||
// Span will be a child of that span, otherwise it will be a root span. This behavior
|
||||
// can be overridden by providing `WithNewRoot()` as a SpanOption, causing the
|
||||
// newly-created Span to be a root span even if `ctx` contains a Span.
|
||||
//
|
||||
// When creating a Span it is recommended to provide all known span attributes using
|
||||
// the `WithAttributes()` SpanOption as samplers will only have access to the
|
||||
// attributes provided when a Span is created.
|
||||
//
|
||||
// Any Span that is created MUST also be ended. This is the responsibility of the user.
|
||||
// Implementations of this API may leak memory or other resources if Spans are not ended.
|
||||
Start(ctx context.Context, spanName string, opts ...SpanOption) (context.Context, Span)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user