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

Init Http::ContextImpl::tracer_ when tracing is enabled, and test it. #5249

Merged
merged 2 commits into from
Dec 8, 2018

Conversation

jmarantz
Copy link
Contributor

@jmarantz jmarantz commented Dec 8, 2018

Description: Re-enables zipkin tracing which was broken by #4997 where I failed to hook up the constructed tracer to the Http::Context and there were no tests that caught it. I had actually done this correctly in the config_validation server, but not in the production server.

Adds a test that the null-tracer gets overridden when tracing is enabled in the config.
Risk Level: low
Testing: //test/server:server_test
Docs Changes: n/a
Release Notes: n/a
Fixes: #5241

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz jmarantz requested a review from mattklein123 December 8, 2018 14:41
objectiser
objectiser previously approved these changes Dec 8, 2018
Copy link
Contributor

@objectiser objectiser left a comment

Choose a reason for hiding this comment

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

@jmarantz Tested it, and worked for me. Thanks.

Only comment is that I am not sure that the jaeger_tracing.yaml (and associated test) is required? It is essentially the same configuration as zipkin. Having it included might cause confusion with the native jaeger support.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz
Copy link
Contributor Author

jmarantz commented Dec 8, 2018

@objectiser removed the jaeger testcase, although I'm confused now what the relationship between the two is given

@objectiser
Copy link
Contributor

Jaeger provides an alternative zipkin compatible backend - so from the proxy's perspective they are no different. The example is slightly different due to starting up a Jaeger instance for the backend instead of Zipkin.

Copy link
Member

@mattklein123 mattklein123 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 quickly fixing!

options_.service_cluster_name_ = "some_cluster_name";
options_.service_node_name_ = "some_node_name";
EXPECT_NO_THROW(initialize("test/server/zipkin_tracing.yaml"));
EXPECT_EQ(nullptr, dynamic_cast<Tracing::HttpNullTracer*>(&server_->httpContext().tracer()));
Copy link
Member

Choose a reason for hiding this comment

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

It might be a slightly better test to check for the Zipkin tracer type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed...I probably should have looked deeper. Is the zipkin tracer object exposed?

In any case I could follow up with an edit tomorrow if you want to get the fix in sooner.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah it's a concrete type just like the other tracers. If the config loads we must be compiling in support so it should be available in a header. Sure let's merge now since this is pretty broken as-is and can do a follow up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't seem like there's a specific Zipkin class for this but I added a test for casting to HttpTracerImpl* in #5250.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123 mattklein123 merged commit 6af63e9 into envoyproxy:master Dec 8, 2018
@jmarantz jmarantz deleted the zipkin-break branch December 9, 2018 04:28
jmarantz added a commit that referenced this pull request Dec 9, 2018
Follow-up to #5249 adding tests for being able to cast the tracer to HttpTracerImpl when zipkin is configured.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
…envoyproxy#5249)

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
Follow-up to envoyproxy#5249 adding tests for being able to cast the tracer to HttpTracerImpl when zipkin is configured.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
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.

3 participants