1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-23 22:34:47 +02:00

Update API configs. (#1921)

* Added Reason to Contributing and Updated TracerConfig

* PR comment fixup

* Changed how span Options work.

* Fix Markdown linting

* Added meter configs.

* Fixes from PR comments

* fix for missing instrument

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
Aaron Clawson
2021-05-27 09:53:56 -05:00
committed by GitHub
parent 270cc6030a
commit c1f460e097
24 changed files with 452 additions and 282 deletions

View File

@@ -36,8 +36,8 @@ var _ trace.Tracer = &tracer{}
// span context found in the passed context. The created Span will be
// configured appropriately by any SpanOption passed. Any Timestamp option
// passed will be used as the start time of the Span's life-cycle.
func (tr *tracer) Start(ctx context.Context, name string, options ...trace.SpanOption) (context.Context, trace.Span) {
config := trace.NewSpanConfig(options...)
func (tr *tracer) Start(ctx context.Context, name string, options ...trace.SpanStartOption) (context.Context, trace.Span) {
config := trace.NewSpanStartConfig(options...)
// For local spans created by this SDK, track child span count.
if p := trace.SpanFromContext(ctx); p != nil {
@@ -47,10 +47,10 @@ func (tr *tracer) Start(ctx context.Context, name string, options ...trace.SpanO
}
span := startSpanInternal(ctx, tr, name, config)
for _, l := range config.Links {
for _, l := range config.Links() {
span.addLink(l)
}
span.SetAttributes(config.Attributes...)
span.SetAttributes(config.Attributes()...)
span.tracer = tr