Introduce meshed label in simulate-proxy (#992)

The proxy does not yet support a `meshed` label.

In anticipation of a `meshed` label in the proxy, introduce this label
in `simulate-proxy`, for testing.

Relates to #306 and #386.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>

secured -> meshed

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
This commit is contained in:
Andrew Seigner 2018-05-23 15:06:11 -07:00 committed by GitHub
parent 6fccdee58e
commit 8a3b1a638a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -370,12 +370,19 @@ func newSimulatedProxy(
// "replica_set", // "replica_set",
} }
// make 50% of requests meshed
meshed := "false"
if rand.Int31n(2) > 0 {
meshed = "true"
}
constLabels := prom.Labels{ constLabels := prom.Labels{
"authority": "fakeauthority:123", "authority": "fakeauthority:123",
"namespace": pod.GetNamespace(), "namespace": pod.GetNamespace(),
"deployment": deploy.Name, "deployment": deploy.Name,
"pod_template_hash": pod.GetLabels()["pod-template-hash"], "pod_template_hash": pod.GetLabels()["pod-template-hash"],
"pod": pod.GetName(), "pod": pod.GetName(),
"meshed": meshed,
// TODO: support other k8s objects // TODO: support other k8s objects
// "daemon_set", // "daemon_set",

View File

@ -34,6 +34,9 @@ Each of these metrics has the following labels:
header of the request. header of the request.
* `direction`: `inbound` if the request originated from outside of the pod, * `direction`: `inbound` if the request originated from outside of the pod,
`outbound` if the request originated from inside of the pod. `outbound` if the request originated from inside of the pod.
* `meshed`: `false` if the request's source and destination were not in the
mesh,
`true` if the request's source and destination were in the mesh.
### Response Labels ### Response Labels