-
Notifications
You must be signed in to change notification settings - Fork 1.3k
proxy: Add client_id label to tcp_open_total metric #5031
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
Comments
Ah yeah, for inbound tcp metrics we only seem to include a boolean.
|
Okay, I've added |
(I realize this issue never actually says "adding this label will make TCP connections show up in |
Thanks @hawkw , this still requires a change in the control plane. I can take care of that. Can you push a proxy image I can use with this change? |
|
In order to have `linkerd edges` return non-empty values for a raw TCP connection's `CLIENT_ID`, the proxy's `tcp_open_total` metric needs to include the `client_id` label for inbound connections, like the `request_total` metrics for http connections does. This PR changes the `TlsStatus` metric label type to include a peer identity in the `Conditional::Some` case, rather than `()`. This means that all metrics with TLS labels will now include the peer identity as a label. I've manually verified that this works by running Linkerd locally and scraping the metrics: For example, here's an excerpt from Grafana: ``` tcp_open_total{peer="src",direction="inbound",tls="no_identity",no_tls_reason="no_tls_from_remote"} 44 tcp_open_total{peer="dst",direction="inbound",tls="no_identity",no_tls_reason="loopback"} 2 tcp_open_total{peer="src",direction="inbound",tls="true",client_id="linkerd-prometheus.linkerd.serviceaccount.identity.linkerd.cluster.local"} 1 ``` And from Prometheus ``` tcp_open_total{peer="dst",authority="10.42.0.25:4191",direction="outbound",dst_control_plane_ns="linkerd",dst_deployment="linkerd-grafana",dst_namespace="linkerd",dst_pod="linkerd-grafana-65597cf467-vq456",dst_pod_template_hash="65597cf467",dst_serviceaccount="linkerd-grafana",tls="true",server_id="linkerd-grafana.linkerd.serviceaccount.identity.linkerd.cluster.local"} 1 tcp_open_total{peer="dst",authority="10.42.0.25:3000",direction="outbound",dst_control_plane_ns="linkerd",dst_deployment="linkerd-grafana",dst_namespace="linkerd",dst_pod="linkerd-grafana-65597cf467-vq456",dst_pod_template_hash="65597cf467",dst_serviceaccount="linkerd-grafana",tls="true",server_id="linkerd-grafana.linkerd.serviceaccount.identity.linkerd.cluster.local"} 1 ``` I'd like to have automated tests for this, but I'd prefer to not have to write them in the integration style, and use the isolated mock service style instead. So, tests can be added once #658 lands. Refs: linkerd/linkerd2#4999 Fixes: linkerd/linkerd2#5031
In order to have
linkerd edges
return non-empty values for a connection'sCLIENT_ID
in the case of TCP connections, the proxy'stcp_open_total
metric needs to include theclient_id
label for inbound connections, like therequest_total
one for http connections does.Ref #4999
The text was updated successfully, but these errors were encountered: