metrics: add peer identities to all TLS metric labels #687
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.
In order to have
linkerd edges
return non-empty values for a raw TCPconnection's
CLIENT_ID
, the proxy'stcp_open_total
metric needs toinclude the
client_id
label for inbound connections, like therequest_total
metrics for http connections does.This PR changes the
TlsStatus
metric label type to include a peeridentity in the
Conditional::Some
case, rather than()
. This meansthat 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:
And from Prometheus
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