Skip to content

Commit 80ca7f7

Browse files
committed
chore(tracing): Cleanup remanants of old tracing infrastructure
Signed-off-by: Scott Fleener <[email protected]>
1 parent cdbe533 commit 80ca7f7

File tree

16 files changed

+13
-120
lines changed

16 files changed

+13
-120
lines changed
Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,15 @@
1-
use linkerd_error::Error;
1+
use linkerd_opentelemetry::otel::trace::SpanKind;
22
use linkerd_stack::layer;
3-
use linkerd_trace_context::{
4-
self as trace_context,
5-
export::{ExportSpan, SpanKind, SpanLabels},
6-
Span, TraceContext,
7-
};
8-
use std::sync::Arc;
9-
use tokio::sync::mpsc;
10-
11-
pub type SpanSink = mpsc::Sender<ExportSpan>;
3+
use linkerd_trace_context::{export::SpanLabels, TraceContext};
124

135
pub fn server<S>(
14-
_sink: Option<SpanSink>,
156
labels: impl Into<SpanLabels>,
167
) -> impl layer::Layer<S, Service = TraceContext<S>> + Clone {
178
TraceContext::layer(SpanKind::Server, labels.into())
189
}
1910

2011
pub fn client<S>(
21-
_sink: Option<SpanSink>,
2212
labels: impl Into<SpanLabels>,
2313
) -> impl layer::Layer<S, Service = TraceContext<S>> + Clone {
2414
TraceContext::layer(SpanKind::Client, labels.into())
2515
}
26-
27-
#[derive(Clone)]
28-
pub struct SpanConverter {
29-
kind: SpanKind,
30-
sink: SpanSink,
31-
labels: SpanLabels,
32-
}
33-
34-
impl trace_context::SpanSink for SpanConverter {
35-
fn is_enabled(&self) -> bool {
36-
true
37-
}
38-
39-
fn try_send(&mut self, span: Span) -> Result<(), Error> {
40-
self.sink.try_send(ExportSpan {
41-
span,
42-
kind: self.kind,
43-
labels: Arc::clone(&self.labels),
44-
})?;
45-
Ok(())
46-
}
47-
}

linkerd/app/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ pub struct ProxyRuntime {
6565
pub identity: identity::creds::Receiver,
6666
pub metrics: metrics::Proxy,
6767
pub tap: proxy::tap::Registry,
68-
pub span_sink: Option<http_tracing::SpanSink>,
6968
pub drain: drain::Watch,
7069
}
7170

linkerd/app/inbound/src/http/router.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<C> Inbound<C> {
134134
endpoint_labels(unsafe_authority_labels),
135135
),
136136
)
137-
.push_on_service(http_tracing::client(rt.span_sink.clone(), super::trace_labels()))
137+
.push_on_service(http_tracing::client(super::trace_labels()))
138138
.push_on_service(http::BoxResponse::layer())
139139
.arc_new_http();
140140

linkerd/app/inbound/src/http/server.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ impl<H> Inbound<H> {
7878
.push_on_service(svc::MapErr::layer_boxed())
7979
.push(rt.metrics.http_errors.to_layer())
8080
.push(ServerRescue::layer())
81-
.push_on_service(http_tracing::server(
82-
rt.span_sink.clone(),
83-
super::trace_labels(),
84-
))
81+
.push_on_service(http_tracing::server(super::trace_labels()))
8582
// Record when an HTTP/1 URI was in absolute form
8683
.push_on_service(http::normalize_uri::MarkAbsoluteForm::layer())
8784
.push_on_service(http::BoxResponse::layer())

linkerd/app/inbound/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ pub use self::{
2525
};
2626
use linkerd_app_core::{
2727
config::{ProxyConfig, QueueConfig},
28-
drain,
29-
http_tracing::SpanSink,
30-
identity,
28+
drain, identity,
3129
metrics::prom,
3230
proxy::tap,
3331
svc,
@@ -71,7 +69,6 @@ struct Runtime {
7169
metrics: InboundMetrics,
7270
identity: identity::creds::Receiver,
7371
tap: tap::Registry,
74-
span_sink: Option<SpanSink>,
7572
drain: drain::Watch,
7673
}
7774

@@ -154,7 +151,6 @@ impl Inbound<()> {
154151
metrics: InboundMetrics::new(runtime.metrics, prom),
155152
identity: runtime.identity,
156153
tap: runtime.tap,
157-
span_sink: runtime.span_sink,
158154
drain: runtime.drain,
159155
};
160156
Self {

linkerd/app/inbound/src/test_util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ pub fn runtime() -> (ProxyRuntime, drain::Signal) {
9999
identity: identity::creds::default_for_test().1,
100100
metrics: metrics.proxy,
101101
tap,
102-
span_sink: None,
103102
drain,
104103
};
105104
(runtime, drain_tx)

linkerd/app/outbound/src/http/endpoint.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ impl<T> Outbound<svc::ArcNewHttp<T, http::BoxBody>> {
117117
.http_endpoint
118118
.to_layer::<classify::Response, _, _>(),
119119
)
120-
.push_on_service(http_tracing::client(
121-
rt.span_sink.clone(),
122-
crate::trace_labels(),
123-
))
120+
.push_on_service(http_tracing::client(crate::trace_labels()))
124121
.push(NewRequireIdentity::layer())
125122
.push(http::NewOverrideAuthority::layer(vec![
126123
"host",

linkerd/app/outbound/src/http/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl<T> Outbound<svc::ArcNewCloneHttp<T>> {
4848
.push(ServerRescue::layer(config.emit_headers))
4949
.check_new_service::<T, http::Request<_>>()
5050
// Initiates OpenTelemetry tracing.
51-
.push_on_service(http_tracing::server(rt.span_sink.clone(), trace_labels()))
51+
.push_on_service(http_tracing::server(trace_labels()))
5252
.push_on_service(http::BoxResponse::layer())
5353
// Convert origin form HTTP/1 URIs to absolute form for Hyper's
5454
// `Client`.

linkerd/app/outbound/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use linkerd_app_core::{
1010
config::{ProxyConfig, QueueConfig},
1111
drain,
1212
exp_backoff::ExponentialBackoff,
13-
http_tracing::SpanSink,
1413
identity, io,
1514
metrics::prom,
1615
profiles,
@@ -97,7 +96,6 @@ struct Runtime {
9796
metrics: OutboundMetrics,
9897
identity: identity::NewClient,
9998
tap: tap::Registry,
100-
span_sink: Option<SpanSink>,
10199
drain: drain::Watch,
102100
}
103101

@@ -127,7 +125,6 @@ impl Outbound<()> {
127125
metrics: OutboundMetrics::new(runtime.metrics, prom),
128126
identity: runtime.identity.new_client(),
129127
tap: runtime.tap,
130-
span_sink: runtime.span_sink,
131128
drain: runtime.drain,
132129
};
133130
Self {

linkerd/app/outbound/src/test_util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ pub(crate) fn runtime() -> (ProxyRuntime, drain::Signal) {
6363
identity: linkerd_meshtls::creds::default_for_test().1,
6464
metrics: metrics.proxy,
6565
tap,
66-
span_sink: None,
6766
drain,
6867
};
6968
(runtime, drain_tx)

0 commit comments

Comments
 (0)