Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Export StartSpanFromContextWithTracer #152

Closed
wants to merge 2 commits into from

Conversation

devoxel
Copy link

@devoxel devoxel commented Jun 26, 2017

Originally discussed in #149 . This is a fairly simple PR. It just exports a helper function that already exists.

It can be useful for people not using the global tracer. It's only a small thing really, but still, could be nice.

@yurishkuro
Copy link
Member

@bhs @tedsuo any objections to exposing this method?

We could also simplify the name to just opentracing.StartSpan(context.Context, Tracer)

@bhs
Copy link
Contributor

bhs commented Aug 7, 2017

@yurishkuro

We could also simplify the name to just opentracing.StartSpan(context.Context, Tracer)

Might be a little odd / asymmetric given the presence of opentracing.StartSpanFromContext... I don't have strong feelings, though.

@devoxel
Copy link
Author

devoxel commented Oct 18, 2017

The name does seem a bit long. I was wondering, is there any strong reason why Tracer isn't potentially a SpanOption? It could potentially be nice to have the same API across the board.

@dobegor
Copy link

dobegor commented May 24, 2018

Are there any objections to merge this?

Copy link
Contributor

@bhs bhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any strong reason why Tracer isn't potentially a SpanOption?

Conceptually that feels off to me... StartSpan is part of the Tracer interface, so providing one as a SpanOption param would be redundant.

I'm ok merging this. That said, gocontext.go is in a conflict state, so that needs to be resolved first.

// It's behavior is identical to StartSpanFromContext except that it takes an explicit
// tracer as opposed to using the global tracer.
func StartSpanFromContextWithTracer(ctx context.Context, tracer Tracer, operationName string, opts ...StartSpanOption) (Span, context.Context) {
var span Span
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build fails because this statement is not needed

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devoxel would you please fix it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants