Expand 'linkerd edges' to work with TCP connections#5040
Merged
Conversation
Fixes #4999 Before: ``` $ bin/linkerd edges po -owide SRC DST SRC_NS DST_NS CLIENT_ID SERVER_ID SECURED linkerd-prometheus-764ddd4f88-t6c2j rabbitmq-controller-5c6cf7cc6d-8lxp2 linkerd default √ linkerd-prometheus-764ddd4f88-t6c2j temp linkerd default √ ``` After: ``` $ bin/linkerd edges po -owide SRC DST SRC_NS DST_NS CLIENT_ID SERVER_ID SECURED temp rabbitmq-controller-5c6cf7cc6d-5fpsc default default default.default default.default √ linkerd-prometheus-66fb97b7fc-vpnxf rabbitmq-controller-5c6cf7cc6d-5fpsc linkerd default √ linkerd-prometheus-66fb97b7fc-vpnxf temp linkerd default √ ``` With the latest proxy upgrade to v2.113.0 (#5037), the `tcp_open_total` metric now contains the `client_id` label so that we can replace the http-only metric `response_total` with this one to determine edges for TCP-only connections. This change basically performs the same query as before, but two times, one for `response_total` and another for `tcp_open_total`. For each resulting entry, the latter is kept if `client_id` is present, otherwise the former is used (if present at all). That way things keep on working for older proxies. Disclaimers: - This doesn't fix #3706: if two sources connect to the same destination there's no way to tell them appart from the metrics perspective and their edges can get mangled. To fix that, the proxy would have to expose `src_resource` labels in the `tcp_open_total` total inbound metric. - Note connections coming from prometheus are still unidentified. The reason is those hit the proxy's admin server (instead of the main container) which doesn't expose metrics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4999
Before:
After:
With the latest proxy upgrade to v2.113.0 (#5037), the
tcp_open_totalmetric now contains theclient_idlabel so that we can replace the http-only metricresponse_totalwith this one to determine edges for TCP-only connections.This change basically performs the same query as before, but two times, one for
response_totaland another fortcp_open_total. For each resulting entry, the latter is kept ifclient_idis present, otherwise the former is used (if present at all). That way things keep on working for older proxies.Disclaimers:
src_resourcelabels in thetcp_open_totaltotal inbound metric.