Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions api/envoy/config/trace/v3/opencensus.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ message OpenCensusConfig {
core.v3.GrpcService stackdriver_grpc_service = 13;

// Enables the Zipkin exporter if set to true. The url and service name must
// also be set.
bool zipkin_exporter_enabled = 5;

// The URL to Zipkin, e.g. "http://127.0.0.1:9411/api/v2/spans"
string zipkin_url = 6;
// also be set. This is deprecated, prefer to use Envoy's :ref:`native Zipkin
// tracer <envoy_v3_api_msg_config.trace.v3.ZipkinConfig>`.
bool zipkin_exporter_enabled = 5 [deprecated = true];

// The URL to Zipkin, e.g. "http://127.0.0.1:9411/api/v2/spans". This is
// deprecated, prefer to use Envoy's :ref:`native Zipkin tracer
// <envoy_v3_api_msg_config.trace.v3.ZipkinConfig>`.
string zipkin_url = 6 [deprecated = true];

// Enables the OpenCensus Agent exporter if set to true. The ocagent_address or
// ocagent_grpc_service must also be set.
Expand Down
11 changes: 3 additions & 8 deletions api/envoy/extensions/tracers/opencensus/v4alpha/opencensus.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,4 @@ Deprecated
* logging: the `--log-format-prefix-with-location` option is removed.
* ratelimit: the :ref:`dynamic metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.dynamic_metadata>` action is deprecated in favor of the more generic :ref:`metadata <envoy_v3_api_field_config.route.v3.RateLimit.Action.metadata>` action.
* stats: the `--use-fake-symbol-table` option is removed.
* tracing: OpenCensus :ref:`Zipkin configuration <envoy_api_field_config.trace.v2.OpenCensusConfig.zipkin_exporter_enabled>` is now deprecated, the preferred Zipkin export is via Envoy's :ref:`native Zipkin tracer <envoy_v3_api_msg_config.trace.v3.ZipkinConfig>`.
13 changes: 8 additions & 5 deletions generated_api_shadow/envoy/config/trace/v3/opencensus.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 34 additions & 2 deletions test/extensions/tracers/opencensus/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ TEST(OpenCensusTracerConfigTest, OpenCensusHttpTracerWithTypedConfig) {
stdout_exporter_enabled: true
stackdriver_exporter_enabled: true
stackdriver_project_id: test_project_id
zipkin_exporter_enabled: true
zipkin_url: http://127.0.0.1:9411/api/v2/spans
ocagent_exporter_enabled: true
ocagent_address: 127.0.0.1:55678
incoming_trace_context: b3
Expand All @@ -123,6 +121,40 @@ TEST(OpenCensusTracerConfigTest, OpenCensusHttpTracerWithTypedConfig) {
{32, 32, 128, 32, ::opencensus::trace::ProbabilitySampler(1e-4)});
}

TEST(OpenCensusTracerConfigTest,
DEPRECATED_FEATURE_TEST(OpenCensusHttpTracerWithDeprecatedTypedConfig)) {
NiceMock<Server::Configuration::MockTracerFactoryContext> context;
const std::string yaml_string = R"EOF(
http:
name: opencensus
typed_config:
"@type": type.googleapis.com/envoy.config.trace.v3.OpenCensusConfig
trace_config:
rate_limiting_sampler:
qps: 123
zipkin_exporter_enabled: true
zipkin_url: http://127.0.0.1:9411/api/v2/spans
incoming_trace_context: b3
incoming_trace_context: trace_context
incoming_trace_context: grpc_trace_bin
incoming_trace_context: cloud_trace_context
outgoing_trace_context: trace_context
)EOF";

envoy::config::trace::v3::Tracing configuration;
TestUtility::loadFromYaml(yaml_string, configuration);

OpenCensusTracerFactory factory;
auto message = Config::Utility::translateToFactoryConfig(
configuration.http(), ProtobufMessage::getStrictValidationVisitor(), factory);
Tracing::HttpTracerSharedPtr tracer = factory.createHttpTracer(*message, context);
EXPECT_NE(nullptr, tracer);

// Reset TraceParams back to default.
::opencensus::trace::TraceConfig::SetCurrentTraceParams(
{32, 32, 128, 32, ::opencensus::trace::ProbabilitySampler(1e-4)});
}

TEST(OpenCensusTracerConfigTest, OpenCensusHttpTracerGrpc) {
NiceMock<Server::Configuration::MockTracerFactoryContext> context;
const std::string yaml_string = R"EOF(
Expand Down