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

Deprecate InitGlobalTracer in favor of SetGlobalTracer #128

Merged
merged 2 commits into from Dec 2, 2016

Conversation

yurishkuro
Copy link
Member

@yurishkuro yurishkuro commented Nov 30, 2016

  • Clarify the purpose of NoopTracer

This was referenced Nov 30, 2016
@bhs
Copy link
Contributor

bhs commented Dec 1, 2016

My only other thought would be to make the global tracer an exported var... unless we think the mutator (or accessor) will eventually do something more interesting?

@yurishkuro
Copy link
Member Author

I'm fine with a var. But GlobalTracer isn't backwards compatible with the current method name. DefaultTracer is an option.

@bhs
Copy link
Contributor

bhs commented Dec 1, 2016

Meh, I thought about it some more and like what you have here. If for some reason we decide to do more than just set the (unexported) global var someday, this will be better.

@bhs
Copy link
Contributor

bhs commented Dec 1, 2016

(i.e., LGTM)

Copy link
Contributor

@kriskowal kriskowal left a comment

Choose a reason for hiding this comment

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

Needs a change log entry. Recommend major version bump, or alternately alias Init*

@bhs
Copy link
Contributor

bhs commented Dec 1, 2016

@kriskowal it's already aliased.

// not need to keep checking if the tracer instance is nil.
//
// For the same reason, the NoopTracer is the default "global" tracer
// (see GlobalTracer and SetGlobalTracer functions).
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also note that NoopTracer is not suitable for RPC frameworks because it does not propagate baggage.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a warning below. But I don't think it's fair to say that it's not suitable for RPC frameworks - it is used in TChannel, for example. Even if we took a reverse approach and built tracing on top of distributed context propagation, there'd still be a case where API for context propagation would have a no-op implementation meaning "no context propagation", and you'd have the same problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. It is perhaps too strong to claim that NoopTracer is suitable for RPC, since it would need to bring its own baggage propagation to the table like TChannel, just as it is too strong to claim that it is not suitable for RPC.

@@ -1,7 +1,8 @@
language: go

go:
- 1.5
Copy link

Choose a reason for hiding this comment

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

You can't drop support for 1.5 now that you've gone 1.0 - the customer expectation is that within 1.x, there are no breaking changes. Removing this would mean we wouldn't know if 1.5 was broken within the 1.x series.

Copy link
Member Author

Choose a reason for hiding this comment

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

See #130

// (etc) globals are noops.
func InitGlobalTracer(tracer Tracer) {
func SetGlobalTracer(tracer Tracer) {

Choose a reason for hiding this comment

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

Renaming this is a backwards breaking change. Suggest creating an alias instead, or incrementing the major version.

Choose a reason for hiding this comment

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

Looks like there is an alias.

@@ -25,3 +25,8 @@ func GlobalTracer() Tracer {
func StartSpan(operationName string, opts ...StartSpanOption) Span {
return globalTracer.StartSpan(operationName, opts...)
}

// InitGlobalTracer is deprecated. Please use SetGlobalTracer.
func InitGlobalTracer(tracer Tracer) {
Copy link
Contributor

Choose a reason for hiding this comment

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

found it, thanks @bensigelman

@yurishkuro yurishkuro changed the title Clarify the purpose of NoopTracer; rename InitGlobalTracer to Set… Deprecate InitGlobalTracer in favor of SetGlobalTracer Dec 2, 2016
// not need to keep checking if the tracer instance is nil.
//
// For the same reason, the NoopTracer is the default "global" tracer
// (see GlobalTracer and SetGlobalTracer functions).
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. It is perhaps too strong to claim that NoopTracer is suitable for RPC, since it would need to bring its own baggage propagation to the table like TChannel, just as it is too strong to claim that it is not suitable for RPC.

@yurishkuro yurishkuro merged commit ac5446f into master Dec 2, 2016
RaduBerinde added a commit to RaduBerinde/lightstep-tracer-go that referenced this pull request Dec 8, 2016
`InitGlobalTracer` was deprecated for `SetGlobalTracer` in opentracing/opentracing-go#128
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

4 participants