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

Customize for Personio's use case based on v2.186.0 #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion linkerd/app/admin/src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ impl Param<metrics::EndpointLabels> for Permitted {
metrics::InboundEndpointLabels {
tls: self.http.tcp.tls.clone(),
authority: None,
target_addr: self.http.tcp.addr.into(),
policy: self.permit.labels.clone(),
}
.into()
Expand Down
8 changes: 2 additions & 6 deletions linkerd/app/core/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub use linkerd_metrics::*;
use linkerd_server_policy as policy;
use std::{
fmt::{self, Write},
net::SocketAddr,
sync::Arc,
time::Duration,
};
Expand Down Expand Up @@ -67,7 +66,6 @@ pub enum EndpointLabels {
pub struct InboundEndpointLabels {
pub tls: tls::ConditionalServerTls,
pub authority: Option<http::uri::Authority>,
pub target_addr: SocketAddr,
pub policy: RouteAuthzLabels,
}

Expand Down Expand Up @@ -101,7 +99,6 @@ pub struct OutboundEndpointLabels {
pub server_id: tls::ConditionalClientTls,
pub authority: Option<http::uri::Authority>,
pub labels: Option<String>,
pub target_addr: SocketAddr,
}

#[derive(Clone, Debug, PartialEq, Eq, Hash)]
Expand Down Expand Up @@ -306,7 +303,7 @@ impl FmtLabels for InboundEndpointLabels {
}

(
(TargetAddr(self.target_addr), TlsAccept::from(&self.tls)),
(TlsAccept::from(&self.tls)),
&self.policy,
)
.fmt_labels(f)?;
Expand Down Expand Up @@ -373,9 +370,8 @@ impl FmtLabels for OutboundEndpointLabels {
write!(f, ",")?;
}

let ta = TargetAddr(self.target_addr);
let tls = TlsConnect::from(&self.server_id);
(ta, tls).fmt_labels(f)?;
(tls).fmt_labels(f)?;

if let Some(labels) = self.labels.as_ref() {
write!(f, ",{}", labels)?;
Expand Down
3 changes: 1 addition & 2 deletions linkerd/app/inbound/src/http/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ impl Param<metrics::EndpointLabels> for Logical {
fn param(&self) -> metrics::EndpointLabels {
metrics::InboundEndpointLabels {
tls: self.tls.clone(),
authority: self.logical.as_ref().map(|d| d.as_http_authority()),
target_addr: self.addr.into(),
authority: None,
policy: self.permit.labels.clone(),
}
.into()
Expand Down
13 changes: 6 additions & 7 deletions linkerd/app/outbound/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,14 @@ impl<P> svc::Param<transport::labels::Key> for Endpoint<P> {

impl<P> svc::Param<metrics::OutboundEndpointLabels> for Endpoint<P> {
fn param(&self) -> metrics::OutboundEndpointLabels {
let authority = self
.logical_addr
.as_ref()
.map(|LogicalAddr(a)| a.as_http_authority());

let dst_labels_arc = self.metadata.labels();
let dst_labels_for_metrics = dst_labels_arc.iter().filter(|(k, _v)| k.as_str() != "pod" && k.as_str() != "pod_template_hash");

metrics::OutboundEndpointLabels {
authority,
labels: metrics::prefix_labels("dst", self.metadata.labels().iter()),
authority: None,
labels: metrics::prefix_labels("dst", dst_labels_for_metrics),
server_id: self.tls.clone(),
target_addr: self.addr.into(),
}
}
}
Expand Down