Skip to content

tracing: Configure tracer from v2 proto configuration#4518

Merged
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
objectiser:tracingconfig
Oct 3, 2018
Merged

tracing: Configure tracer from v2 proto configuration#4518
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
objectiser:tracingconfig

Conversation

@objectiser
Copy link
Contributor

@objectiser objectiser commented Sep 24, 2018

Description:
Use v2 proto config to configure the tracer.

Risk Level: medium

Testing:
Updated the unit tests to use yaml and the v2 proto model.

Fixes #3459

@objectiser objectiser force-pushed the tracingconfig branch 2 times, most recently from ffe6c4b to 079a3c5 Compare September 24, 2018 20:20
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wondering whether this field should be changed to BoolValue wrapper? The default is currently false, but in the future we may want to change that to true as 128bit ids are becoming more common.

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 not worth, changing bool to BoolValue is a backward incompatible change so you'll need to follow deprecation process, changing default to true is another breaking change I guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree - so will leave for now and wait for it to be raised as an issue.

Copy link
Member

Choose a reason for hiding this comment

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

Can you factor out this to Server::Configuration and let the interface have createEmptyProto as well, just like other extensions? This will make extension interface stable and easier for #4475.

Signed-off-by: Gary Brown <gary@brownuk.com>
Signed-off-by: Gary Brown <gary@brownuk.com>
@objectiser
Copy link
Contributor Author

@lizan Fix applied - not sure why the ipv6_tests failed - do you have permissions to rerun?

Copy link
Member

@lizan lizan left a comment

Choose a reason for hiding this comment

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

Great, a few nits.

Server::Instance& server) override;

ProtobufTypes::MessagePtr createEmptyConfigProto() override {
return ProtobufTypes::MessagePtr{new envoy::config::trace::v2::DynamicOtConfig()};
Copy link
Member

Choose a reason for hiding this comment

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

nit: std::make_unique

Tracing::DriverPtr lightstep_driver{new LightStepDriver{
json_config, server.clusterManager(), server.stats(), server.threadLocal(), server.runtime(),
std::move(opts), Common::Ot::OpenTracingDriver::PropagationMode::TracerNative}};
Tracing::DriverPtr lightstep_driver{
Copy link
Member

Choose a reason for hiding this comment

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

std::make_unique

Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry missed that.

Server::Instance& server) override;

ProtobufTypes::MessagePtr createEmptyConfigProto() override {
return ProtobufTypes::MessagePtr{new envoy::config::trace::v2::LightstepConfig()};
Copy link
Member

Choose a reason for hiding this comment

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

ditto

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 not worth, changing bool to BoolValue is a backward incompatible change so you'll need to follow deprecation process, changing default to true is another breaking change I guess?

dynamic_cast<const envoy::config::trace::v2::DynamicOtConfig&>(*config_ptr);

const std::string library = dynaot_config.library();
Json::ObjectSharedPtr json_config = MessageUtil::getJsonObjectFromMessage(dynaot_config.config());
Copy link
Member

Choose a reason for hiding this comment

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

use MessageUtil::getJsonStringFromMessage

Signed-off-by: Gary Brown <gary@brownuk.com>
@objectiser
Copy link
Contributor Author

objectiser commented Sep 29, 2018

@lizan Test failed due to "No space left on device"

Tracing::DriverPtr lightstep_driver{new LightStepDriver{
json_config, server.clusterManager(), server.stats(), server.threadLocal(), server.runtime(),
std::move(opts), Common::Ot::OpenTracingDriver::PropagationMode::TracerNative}};
Tracing::DriverPtr lightstep_driver{
Copy link
Member

Choose a reason for hiding this comment

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

?

Server::Instance& server) override;

ProtobufTypes::MessagePtr createEmptyConfigProto() override {
return ProtobufTypes::MessagePtr{std::make_unique<envoy::config::trace::v2::LightstepConfig>()};
Copy link
Member

Choose a reason for hiding this comment

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

I think you can just return std::make_unique<...>(); without wrapping into MessagePtr

Signed-off-by: Gary Brown <gary@brownuk.com>
@objectiser
Copy link
Contributor Author

@lizan hopefully all sorted now.

@lizan lizan requested a review from htuch October 3, 2018 16:56
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.

Nice, thanks for cleaning this up.

@mattklein123 mattklein123 merged commit 38a8be2 into envoyproxy:master Oct 3, 2018
aa-stripe pushed a commit to aa-stripe/envoy that referenced this pull request Oct 11, 2018
Signed-off-by: Gary Brown <gary@brownuk.com>
Signed-off-by: Aaltan Ahmad <aa@stripe.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