Skip to content

Commit 76db762

Browse files
authored
outbound: fix Balance::Dispatch "authority" labels (#2332)
PR #2313 changed client policies with the load balancer dispatch type to report the load balancer's destination address as the "authority" label, rather than the numeric authority the policy was discovered for. However, this change was accidentally undone when merging PR #2260, which moved the code where the authority label is generated to a different file. This PR changes it back, so that the discovered concrete destination address should still be reported as the "authority" metrics label.
1 parent 703782c commit 76db762

File tree

1 file changed

+13
-5
lines changed
  • linkerd/app/outbound/src/http/logical/policy

1 file changed

+13
-5
lines changed

linkerd/app/outbound/src/http/logical/policy/router.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,20 @@ where
109109
} = rts;
110110

111111
let mk_concrete = {
112-
let authority = addr.to_http_authority();
113112
let parent = parent.clone();
114-
move |target: concrete::Dispatch| Concrete {
115-
target,
116-
authority: Some(authority.clone()),
117-
parent: parent.clone(),
113+
move |target: concrete::Dispatch| {
114+
// XXX With policies we don't have a top-level authority name at
115+
// the moment. So, instead, we use the concrete addr used for
116+
// discovery for now.
117+
let authority = match target {
118+
concrete::Dispatch::Balance(ref a, _) => Some(a.as_http_authority()),
119+
_ => None,
120+
};
121+
Concrete {
122+
target,
123+
authority,
124+
parent: parent.clone(),
125+
}
118126
}
119127
};
120128

0 commit comments

Comments
 (0)