mirror of https://github.com/linkerd/linkerd2.git
* Expand 'linkerd edges' to work with TCP connections 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. |
||
---|---|---|
.. | ||
testdata | ||
client.go | ||
client_test.go | ||
edges.go | ||
edges_test.go | ||
gateways.go | ||
grpc_server.go | ||
grpc_server_test.go | ||
http_server.go | ||
http_server_test.go | ||
prometheus.go | ||
stat_summary.go | ||
stat_summary_test.go | ||
stream_client.go | ||
test_helper.go | ||
top_routes.go | ||
top_routes_test.go |