Skip to content

move global trace provider api to global package.#240

Merged
rghetia merged 3 commits intoopen-telemetry:masterfrom
rghetia:global_package
Oct 25, 2019
Merged

move global trace provider api to global package.#240
rghetia merged 3 commits intoopen-telemetry:masterfrom
rghetia:global_package

Conversation

@rghetia
Copy link
Copy Markdown
Contributor

@rghetia rghetia commented Oct 24, 2019

partially addresses #216

Comment thread global/global.go Outdated

// GlobalProvider returns trace provider registered with global registry.
// If no trace provider is registered then an instance of NoopTraceProvider is returned.
// TraceProvider returns registered global trace provider.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// TraceProvider returns registered global trace provider.
// TraceProvider returns the registered global trace provider.

or

Suggested change
// TraceProvider returns registered global trace provider.
// TraceProvider returns the configured global trace provider.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done.

Comment thread global/global.go Outdated
// SetGlobalProvider sets the provider as a global trace provider.
func SetGlobalProvider(m Provider) {
globalP.Store(globalProvider{p: m})
// SetTraceProvider configures the provider as a global trace provider.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// SetTraceProvider configures the provider as a global trace provider.
// SetTraceProvider registers p as the global trace provider.

or

Suggested change
// SetTraceProvider configures the provider as a global trace provider.
// SetTraceProvider configures p to be the global trace provider.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done.

@jmacd
Copy link
Copy Markdown
Contributor

jmacd commented Oct 25, 2019

There is a static function in api/trace/api.go,

// Start starts a new span using registered global tracer.
func Start(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span) {
	return GlobalTracer().Start(ctx, name, opts...)
}

I think this should be eliminated. There should be no uses of a global from within the api/trace package i9tself.

@rghetia
Copy link
Copy Markdown
Contributor Author

rghetia commented Oct 25, 2019

I think this should be eliminated. There should be no uses of a global from within the api/trace package i9tself.

It was eliminated in #227

@rghetia rghetia merged commit 68310ab into open-telemetry:master Oct 25, 2019
hstan referenced this pull request in hstan/opentelemetry-go Oct 15, 2020
@pellared pellared added this to the untracked milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants