Skip to content

Commit ce3e328

Browse files
committed
chore(tracing)!: Remove OpenCensus trace protocol
OpenCensus as a protocol has been sunset for some time now. Additionally, we have supported its replacement, OpenTelemetry, for a long time now, and we don't even expose the OpenCensus configuration from the linkerd control plane chart. This removes OpenCensus from the proxy. There's some cleanup that will have to be done in follow-ups, but this attempts to keep the diff as minimal as possible. Signed-off-by: Scott Fleener <[email protected]>
1 parent 5a77924 commit ce3e328

28 files changed

+4
-2320
lines changed

Cargo.lock

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,6 @@ dependencies = [
13741374
"linkerd-app-inbound",
13751375
"linkerd-app-outbound",
13761376
"linkerd-error",
1377-
"linkerd-opencensus",
13781377
"linkerd-opentelemetry",
13791378
"linkerd-tonic-stream",
13801379
"linkerd-workers",
@@ -1436,7 +1435,6 @@ dependencies = [
14361435
"linkerd-meshtls",
14371436
"linkerd-metrics",
14381437
"linkerd-mock-http-body",
1439-
"linkerd-opencensus",
14401438
"linkerd-opentelemetry",
14411439
"linkerd-proxy-api-resolve",
14421440
"linkerd-proxy-balance",
@@ -2061,22 +2059,6 @@ dependencies = [
20612059
name = "linkerd-opaq-route"
20622060
version = "0.1.0"
20632061

2064-
[[package]]
2065-
name = "linkerd-opencensus"
2066-
version = "0.1.0"
2067-
dependencies = [
2068-
"futures",
2069-
"http-body",
2070-
"linkerd-error",
2071-
"linkerd-metrics",
2072-
"linkerd-trace-context",
2073-
"opencensus-proto",
2074-
"tokio",
2075-
"tokio-stream",
2076-
"tonic",
2077-
"tracing",
2078-
]
2079-
20802062
[[package]]
20812063
name = "linkerd-opentelemetry"
20822064
version = "0.1.0"
@@ -2930,16 +2912,6 @@ dependencies = [
29302912
"portable-atomic",
29312913
]
29322914

2933-
[[package]]
2934-
name = "opencensus-proto"
2935-
version = "0.1.0"
2936-
dependencies = [
2937-
"prost 0.13.5",
2938-
"prost-types 0.13.5",
2939-
"tonic",
2940-
"tonic-build",
2941-
]
2942-
29432915
[[package]]
29442916
name = "opentelemetry"
29452917
version = "0.30.0"

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ members = [
4646
"linkerd/metrics",
4747
"linkerd/mock/http-body",
4848
"linkerd/opaq-route",
49-
"linkerd/opencensus",
5049
"linkerd/opentelemetry",
5150
"linkerd/pool",
5251
"linkerd/pool/mock",
@@ -85,7 +84,6 @@ members = [
8584
"linkerd/transport-metrics",
8685
"linkerd/workers",
8786
"linkerd2-proxy",
88-
"opencensus-proto",
8987
"spiffe-proto",
9088
"tools",
9189
]

linkerd/app/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ linkerd-app-gateway = { path = "./gateway" }
2525
linkerd-app-inbound = { path = "./inbound" }
2626
linkerd-app-outbound = { path = "./outbound" }
2727
linkerd-error = { path = "../error" }
28-
linkerd-opencensus = { path = "../opencensus" }
2928
linkerd-opentelemetry = { path = "../opentelemetry" }
3029
linkerd-tonic-stream = { path = "../tonic-stream" }
3130
linkerd-workers = { path = "../workers" }

linkerd/app/core/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ linkerd-idle-cache = { path = "../../idle-cache" }
3939
linkerd-io = { path = "../../io" }
4040
linkerd-meshtls = { path = "../../meshtls", default-features = false }
4141
linkerd-metrics = { path = "../../metrics", features = ["process", "stack"] }
42-
linkerd-opencensus = { path = "../../opencensus" }
4342
linkerd-opentelemetry = { path = "../../opentelemetry" }
4443
linkerd-proxy-api-resolve = { path = "../../proxy/api-resolve" }
4544
linkerd-proxy-balance = { path = "../../proxy/balance" }

linkerd/app/core/src/http_tracing.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@ use tokio::sync::mpsc;
1111
#[derive(Debug, Copy, Clone, Default)]
1212
pub enum CollectorProtocol {
1313
#[default]
14-
OpenCensus,
1514
OpenTelemetry,
1615
}
1716

1817
impl FromStr for CollectorProtocol {
1918
type Err = ();
2019

2120
fn from_str(s: &str) -> Result<Self, Self::Err> {
22-
if s.eq_ignore_ascii_case("opencensus") {
23-
Ok(Self::OpenCensus)
24-
} else if s.eq_ignore_ascii_case("opentelemetry") {
21+
if s.eq_ignore_ascii_case("opentelemetry") {
2522
Ok(Self::OpenTelemetry)
2623
} else {
2724
Err(())

linkerd/app/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ pub use linkerd_exp_backoff as exp_backoff;
3939
pub use linkerd_http_metrics as http_metrics;
4040
pub use linkerd_idle_cache as idle_cache;
4141
pub use linkerd_io as io;
42-
pub use linkerd_opencensus as opencensus;
4342
pub use linkerd_opentelemetry as opentelemetry;
4443
pub use linkerd_service_profiles as profiles;
4544
pub use linkerd_stack_metrics as stack_metrics;

linkerd/app/core/src/metrics.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
pub use crate::transport::labels::{TargetAddr, TlsAccept};
1010
use crate::{
1111
classify::Class,
12-
control, http_metrics, opencensus, opentelemetry, profiles, proxy, stack_metrics, svc, tls,
12+
control, http_metrics, opentelemetry, profiles, proxy, stack_metrics, svc, tls,
1313
transport::{self, labels::TlsConnect},
1414
};
1515
use linkerd_addr::Addr;
@@ -37,7 +37,6 @@ pub type Stack = stack_metrics::Registry<StackLabels>;
3737
pub struct Metrics {
3838
pub proxy: Proxy,
3939
pub control: ControlHttp,
40-
pub opencensus: opencensus::metrics::Registry,
4140
pub opentelemetry: opentelemetry::metrics::Registry,
4241
}
4342

@@ -213,13 +212,11 @@ impl Metrics {
213212
transport,
214213
};
215214

216-
let (opencensus, opencensus_report) = opencensus::metrics::new();
217215
let (opentelemetry, opentelemetry_report) = opentelemetry::metrics::new();
218216

219217
let metrics = Metrics {
220218
proxy,
221219
control,
222-
opencensus,
223220
opentelemetry,
224221
};
225222

@@ -230,7 +227,6 @@ impl Metrics {
230227
.and_report(actual_report)
231228
.and_report(control_report)
232229
.and_report(transport_report)
233-
.and_report(opencensus_report)
234230
.and_report(opentelemetry_report)
235231
.and_report(stack);
236232

linkerd/app/src/lib.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,8 @@ impl Config {
206206
let dns = dns.resolver("trace_collector");
207207
let client_metrics = metrics.control.clone();
208208
let otel_metrics = metrics.opentelemetry;
209-
let oc_metrics = metrics.opencensus;
210209
info_span!("tracing").in_scope(|| {
211-
trace_collector.build(
212-
identity,
213-
dns,
214-
oc_metrics,
215-
otel_metrics,
216-
control_metrics,
217-
client_metrics,
218-
)
210+
trace_collector.build(identity, dns, otel_metrics, control_metrics, client_metrics)
219211
})
220212
}?;
221213

linkerd/app/src/trace_collector.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ use linkerd_app_core::{
33
http_tracing::{CollectorProtocol, SpanSink},
44
identity,
55
metrics::ControlHttp as HttpMetrics,
6-
opencensus, opentelemetry,
6+
opentelemetry,
77
svc::NewService,
88
};
99
use linkerd_error::Error;
1010
use otel_collector::OtelCollectorAttributes;
1111
use std::{collections::HashMap, future::Future, pin::Pin};
1212

13-
pub mod oc_collector;
1413
pub mod otel_collector;
1514

1615
const SPAN_BUFFER_CAPACITY: usize = 100;
@@ -59,7 +58,6 @@ impl Config {
5958
match self {
6059
Config::Disabled => None,
6160
Config::Enabled(config) => match config.kind {
62-
CollectorProtocol::OpenCensus => Some("opencensus"),
6361
CollectorProtocol::OpenTelemetry => Some("opentelemetry"),
6462
},
6563
}
@@ -69,7 +67,6 @@ impl Config {
6967
self,
7068
identity: identity::NewClient,
7169
dns: dns::Resolver,
72-
legacy_oc_metrics: opencensus::metrics::Registry,
7370
legacy_otel_metrics: opentelemetry::metrics::Registry,
7471
control_metrics: control::Metrics,
7572
client_metrics: HttpMetrics,
@@ -87,14 +84,6 @@ impl Config {
8784
.unwrap_or_else(|| SERVICE_NAME.to_string());
8885

8986
let collector = match inner.kind {
90-
CollectorProtocol::OpenCensus => oc_collector::create_collector(
91-
addr.clone(),
92-
inner.hostname,
93-
svc_name,
94-
inner.attributes,
95-
svc,
96-
legacy_oc_metrics,
97-
),
9887
CollectorProtocol::OpenTelemetry => {
9988
let attributes = OtelCollectorAttributes {
10089
hostname: inner.hostname,

linkerd/app/src/trace_collector/oc_collector.rs

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)