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

[tracing] add simplified export pipeline setup for Jaeger #459

Merged
merged 6 commits into from
Mar 10, 2020

Conversation

matej-g
Copy link
Contributor

@matej-g matej-g commented Feb 2, 2020

This PR introduces a simplified exporter for Jaeger, similar to recently introduced export pipeline setups (#395) for metrics.

Resolves #424.

Copy link
Contributor

@clsung clsung left a comment

Choose a reason for hiding this comment

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

Is it possible to have tests on InstallNewPipeline/NewExportPipeline?

@matej-g
Copy link
Contributor Author

matej-g commented Feb 3, 2020

Is it possible to have tests on InstallNewPipeline/NewExportPipeline?

Sure thing, should not be a big deal, I'll provide tests as well

// For demoing purposes, use trace.AlwaysSample to sample every trace.
// In a production application, you should configure this to a trace.ProbabilitySampler
// set at the desired probability.
tp.ApplyConfig(sdktrace.Config{
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to see the sdktrace.Config argument passed directly to InstallNewPipeline. Any reason not to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, I guess it depends on what is expected of NewExportPipeline / InstallNewPipeline - as this is supposed to be a simplified setup and there are default values which will be used if no config is passed to the trace provider, it is capable of returning pipeline with default configuration without needing this extra parameter.

On the other hand, I guess default does not necessarily correspond to recommended (and universally recommended config might not exist in this case), which is probably what the simplified pipeline setup should actually do for the user, so providing config would be reasonable as well. I was considering both implementations, so I'm not opposed.

Copy link
Member

Choose a reason for hiding this comment

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

we're already passing in other Jaeger properties to InstallNewPipeline, just not sdktrace.Config... so I'm on the fence here.

Copy link
Member

@paivagustavo paivagustavo Feb 11, 2020

Choose a reason for hiding this comment

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

Mixing functional options with an option struct seems a little weird.

I would love to see an unified functional options for exporters that could configure the underlying SDK as well but I don't know if it is feasible without some adaptations.

Something along the lines should be possible and I think it is better than passing the Options struct directly:

// Create and install Jaeger export pipeline
tp, flush, err := jaeger.InstallNewPipeline(
	jaeger.WithCollectorEndpoint("http://localhost:14268/api/traces"),
	jaeger.WithProcess(jaeger.Process{
		ServiceName: "trace-demo",
		Tags: []core.KeyValue{
			key.String("exporter", "jaeger"),
			key.Float64("float", 312.23),
		},
	}),
	jaeger.WithSDK(
		sdktrace.AlwaysSample(),
		sdktrace.WithDefaultLabelEncoder()
	),
)

@paivagustavo paivagustavo added exporters area:trace Part of OpenTelemetry tracing labels Feb 11, 2020
@rghetia
Copy link
Contributor

rghetia commented Feb 27, 2020

@matej-g would you have time to address the comments?

@matej-g matej-g requested a review from MrAlias as a code owner March 6, 2020 06:07
@rghetia rghetia force-pushed the simplified-exporter-jaeger branch from 415164f to 5f3c381 Compare March 6, 2020 06:59
@rghetia
Copy link
Contributor

rghetia commented Mar 6, 2020

@jmacd , @paivagustavo PTAL, I have updated using consistent With* option as per the review comments.

Copy link
Member

@paivagustavo paivagustavo left a comment

Choose a reason for hiding this comment

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

I'm okay with this. I still think we need to standardize more the initialization of all exporters.


// Registration is set to true if the trace provider of the new pipeline should be
// registered as Global Trace Provider
Registeration bool
Copy link
Member

Choose a reason for hiding this comment

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

There is a typo here. Also, I would suggest to change this to RegisterTrace or RegisterGlobal, what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Either one seems fine. I will pick RegisterGlobal.

I do agree that exporter initialization should be standardized.

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

Similar to @paivagustavo , I'm good with this getting merged, but think we need to standardize initialization. I created #536 to track that work.

exporters/trace/jaeger/jaeger.go Outdated Show resolved Hide resolved
@rghetia rghetia merged commit fe0099f into open-telemetry:master Mar 10, 2020
MikeGoldsmith pushed a commit to MikeGoldsmith/opentelemetry-go that referenced this pull request Mar 13, 2020
…etry#459)

* add simplified export pipeline setup for Jaeger

* add With* options to configure SDK options.

* add test for WithRegistration and WithSDK

* rename Registeration with RegisterGlobal

* rename WithRegistration to RegisterAsGlobal

Co-authored-by: rahulpa <rahulpa@google.com>
Co-authored-by: Joshua MacDonald <jmacd@users.noreply.github.com>
@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
area:trace Part of OpenTelemetry tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add simplified constructor for simple trace SDK setup: Jaeger exporter
8 participants