Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move global Meter and Tracer getter/setters into dedicated globals package #216

Closed
jmacd opened this issue Oct 16, 2019 · 3 comments · Fixed by #258
Closed

Move global Meter and Tracer getter/setters into dedicated globals package #216

jmacd opened this issue Oct 16, 2019 · 3 comments · Fixed by #258
Assignees
Labels
pkg:SDK Related to an SDK package

Comments

@jmacd
Copy link
Contributor

jmacd commented Oct 16, 2019

The proposal is that we move all globals out of the main trace and metrics package. The global tracer and meter objects will be registered in another package, opentelemtry, along with the Init() method discussed in OTEP 0005.

Eliminating globals from the main packages allows globals package to auto-initialize by loading a plugin, for example; if we separate globals from these packages now, this can be a future option. If we leave globals in the main packages, we cannot do this. It is impossible to auto-load a plugin that depends on the package that is loading it. When there are no globals in the packages themselves, it becomes possible for a binary plugin to to be loaded that implements the Tracer or Meter interfaces, at the first moment when the globals are referenced.

There is an old proof-of-concept showing how this could work in the future, provided that we separate globals from the main API packages now. #52

@jmacd
Copy link
Contributor Author

jmacd commented Oct 16, 2019

More concretely, I propose the top-level opentracing package contain something like these three methods:

Init(TracerFactory, MeterFactory) initializes opentracing global factories
GlobalTracer(name string) Tracer gets a named tracer from the global tracer factory
GlobalMeter(name string) Tracer gets a named meter from the global meter factory

@lizthegrey
Copy link
Member

I 1000% endorse this.

@rghetia
Copy link
Contributor

rghetia commented Oct 17, 2019

@rghetia to post the PR with named tracer.

@rghetia rghetia self-assigned this Oct 24, 2019
@rghetia rghetia added the pkg:SDK Related to an SDK package label Oct 24, 2019
@rghetia rghetia modified the milestones: Alpha v0.2, Alpha v0.3 Oct 24, 2019
hstan referenced this issue in hstan/opentelemetry-go Oct 15, 2020
* .  Prepare for releasing v0.10.1

* Update Changelog

* Update Changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:SDK Related to an SDK package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants