-
Notifications
You must be signed in to change notification settings - Fork 661
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
Add start_pipeline to MeterProvider in SDK, atexit moved to MeterProvider #791
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/controller.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The API change looks good to me too: legible.
are there any other examples that should be modified as a result of this?
Also one comment on a loose atexit handler in the actual library code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a suggestion for default controllers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick, thanks!
* remove Gauge instrument
Addresses [#750]
Introduces a way to start the collection/export process via
start_pipeline
as part of theMeterProvider
.See below for usage:
This makes it so that the user does not have to instantiate a
PushController
instance themselves (a concept that is quite confusing) and allows the user a mechanism to explicit say when they want to start collecting/exporting metrics. This makes it so that we do not have to worry about any metrics (or views in the future) defined during/after a collection has already started.As well, the
atexit
logic initially part ofPushController
now belongs to theMeterProvider
, which will callshutdown
on all controllers and exporters upon application exit.I'm using "pipeline" as the term based off the Go implementation but open to other suggestions.