linkerd2/controller/api/public
Alejandro Pedraza 777b06ac55
Expand 'linkerd edges' to work with TCP connections (#5040)
* 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.
2020-10-12 09:14:39 -05:00
..
testdata Push docker images to ghcr.io instead of gcr.io (#4953) 2020-09-10 15:16:24 -05:00
client.go Remove dependency of linkerd-config for control plane components (#4915) 2020-10-06 22:19:18 +05:30
client_test.go Upgrade generated protobuf files to v1.4.2 (#4673) 2020-06-26 09:36:48 -05:00
edges.go Expand 'linkerd edges' to work with TCP connections (#5040) 2020-10-12 09:14:39 -05:00
edges_test.go Upgrade generated protobuf files to v1.4.2 (#4673) 2020-06-26 09:36:48 -05:00
gateways.go Bump k8s client-go to v0.19.2 (#5002) 2020-09-28 12:45:18 -05:00
grpc_server.go Remove dependency of linkerd-config for control plane components (#4915) 2020-10-06 22:19:18 +05:30
grpc_server_test.go Remove dependency of linkerd-config for control plane components (#4915) 2020-10-06 22:19:18 +05:30
http_server.go Remove dependency of linkerd-config for control plane components (#4915) 2020-10-06 22:19:18 +05:30
http_server_test.go Remove dependency of linkerd-config for control plane components (#4915) 2020-10-06 22:19:18 +05:30
prometheus.go Remove/Relax prometheus related checks (#4724) 2020-07-20 14:24:00 -07:00
stat_summary.go Upgrade to client-go 0.17.4 and smi-sdk-go 0.3.0 (#4221) 2020-04-01 10:07:23 -07:00
stat_summary_test.go Add ARM64 Integration Test (#4897) 2020-08-28 10:38:40 -07:00
stream_client.go Introduce tap APIService, update `linkerd tap` (#3167) 2019-08-01 14:02:45 -07:00
test_helper.go Remove dependency of linkerd-config for control plane components (#4915) 2020-10-06 22:19:18 +05:30
top_routes.go Add kubectl-style label selectors (#4120) 2020-03-20 10:45:06 -05:00
top_routes_test.go Upgrade generated protobuf files to v1.4.2 (#4673) 2020-06-26 09:36:48 -05:00