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

Added default configuration for DataDog APM Tracer #3655

Merged
merged 2 commits into from
Jul 26, 2018

Conversation

aantono
Copy link
Contributor

@aantono aantono commented Jul 20, 2018

Fixed DataDog APM initialization error due to missing default configs.

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

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

LGTM

Debug: false,
}
}
if gc.Tracing.DataDog != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Should be

if gc.Tracing.Zipkin != nil {
	log.Warn("Zipkin configuration will be ignored")
	gc.Tracing.Zipkin = nil
}
if gc.Tracing.Jaeger != nil {
	log.Warn("Jaeger configuration will be ignored")
	gc.Tracing.Jaeger = nil
}

or

log.Warn("Zipkin & Jaeger configuration will be ignored")
gc.Tracing.Jaeger = nil
gc.Tracing.Zipkin = nil

According to the chosen solution, you also need to update the Zipkin and Jaeger case

@mmatur
Copy link
Member

mmatur commented Jul 23, 2018

I am not very a fan to have multiple conditional check for each tracer. I would propose different solution.

Solution 1

case jaeger.Name:
	if gc.Tracing.Jaeger == nil {
		gc.Tracing.Jaeger = &jaeger.Config{
			SamplingServerURL:  "http://localhost:5778/sampling",
			SamplingType:       "const",
			SamplingParam:      1.0,
			LocalAgentHostPort: "127.0.0.1:6831",
		}
	}
	if gc.Tracing.Zipkin != nil || gc.Tracing.DataDog != nil {
		log.Warn("Zipkin & DataDog configuration will be ignored")
		gc.Tracing.Zipkin = nil
                gc.Tracing.DataDog = nil
	}

Solution 2

	log.Info("Using Jaeger configuration other tracing configurations will be ignored")
	if gc.Tracing.Jaeger == nil {
		gc.Tracing.Jaeger = &jaeger.Config{
			SamplingServerURL:  "http://localhost:5778/sampling",
			SamplingType:       "const",
			SamplingParam:      1.0,
			LocalAgentHostPort: "127.0.0.1:6831",
		}
	}
	gc.Tracing.Zipkin = nil
	gc.Tracing.DataDog = nil

Personally I prefer the second solution.

WDYT?

Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

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

LGTM

@mmatur mmatur requested review from ldez and removed request for ldez July 25, 2018 14:37
Copy link
Member

@emilevauge emilevauge left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @aantono, great job :)
But I tend to agree with @mmatur, this part is hard to maintain, his 2nd proposal seems great. We can merge this one and work on a refactor in another PR.
LGTM

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

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

LGTM :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants