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

[metrics] standardize/simplify export pipeline setup #395

Merged

Conversation

matej-g
Copy link
Contributor

@matej-g matej-g commented Dec 21, 2019

This PR implements a method for simplified export pipeline setup for stdout exporter.

Resolves #343

Co-authored-by: Liz Fong-Jones [email protected]

exporter/metric/stdout/stdout.go Outdated Show resolved Hide resolved
@lizthegrey lizthegrey changed the title Introduce simplified export pipeline setup for stdout [metrics] simplified export pipeline setup for stdout Dec 31, 2019
@jmacd
Copy link
Contributor

jmacd commented Dec 31, 2019

How about two methods, one InstallNewPipeline and one NewPipeline. The Install form calls NewPipeline and then sets the global provider.

pipeline, err := stdout.InstallNewPipeline(stdout.Options{...})
if err != nil {
 ...
}
defer pipeline.Stop()
// ... Done

* Creates NewRawExporter, NewExportPipeline, InstallNewPipeline methods.
* Uses Options rather than Config throughout for options.
@lizthegrey lizthegrey changed the title [metrics] simplified export pipeline setup for stdout [metrics] standardize/simplify export pipeline setup Dec 31, 2019
@lizthegrey lizthegrey requested a review from jmacd December 31, 2019 20:17
@lizthegrey
Copy link
Member

I've done as you asked on behalf of the original pull submitter, PTAL.

@lizthegrey lizthegrey mentioned this pull request Dec 31, 2019
// Config supports common options that apply to statsd exporters.
Config struct {
// Options supports common options that apply to statsd exporters.
Options struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is an unrelated remark.

I thought we had moved toward the practice of using "Config" as the structure name, and Option as a functional argument (func(*Config)), and Options as a []Option. See api/trace StartConfig and StartOption, for example.

That's why I prefer this struct be called Config.

Copy link
Contributor

Choose a reason for hiding this comment

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

See #369

Copy link
Member

Choose a reason for hiding this comment

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

The goal of this was to standardize the patterns for all Exporter options/config. Prometheus and stdout were using options, statsd was using config...

Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

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

I like the new simplified exporter setup. I would prefer to keep a Config struct.

@lizthegrey
Copy link
Member

lizthegrey commented Jan 2, 2020

I like the new simplified exporter setup. I would prefer to keep a Config struct.

Alright. Let's merge this as is (to make the one case that's Config go to Options for consistency), and then I'll do a quick followup to rename all the Options systematically to Config.

@lizthegrey
Copy link
Member

@paivagustavo want to take a look before we merge?

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.

Add simplified constructor for simple metric SDK setup: stdout exporter.
6 participants