api: Add a metadata field to UpstreamEndpointStats. (#5154)

Description: This field is used to carry opaque and implementation
dependent information of the upstream endpoints. The information may
be used by management server for debugging purposes.

Example: Consider a requirement of per 'user' load stastics for
debugging. Envoy will embed user info into the metadata field for
every upstream endpoint it sends load to. This user information will
be used by management server for debugging.

Sample message:
message ClusterStats {
  cluster_name = ...
  message UpstreamLocalityStats {
    locality = ...
    message UpstreamEndpointStats {
      address = "endpoint1"
      metadata = { "user" : "alice"}
      ...
    }
    message UpstreamEndpointStats {
      address = "endpoint1"
      metadata = { "user" : "bob"}
      ...
    }
    message UpstreamEndpointStats {
      address = "endpoint2"
      metadata = { "user" : "alice"}
      ...
    }
    message UpstreamEndpointStats {
      address = "endpoint3"
      metadata = { "user" : "bob"}
      ...
    }
  }
}

Risk Level: Low
Testing: Compiles successfully.
Signed-off-by: Karthik Reddy <rekarthik@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 8d8cb4a7c63b74633b0b459af9104143b13f657f
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 2a08c3e98a
commit 573cbd8136
  1. 5
      envoy/api/v2/endpoint/load_report.proto

@ -6,6 +6,7 @@ import "envoy/api/v2/core/address.proto";
import "envoy/api/v2/core/base.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "validate/validate.proto";
import "gogoproto/gogo.proto";
@ -57,6 +58,10 @@ message UpstreamEndpointStats {
// Upstream host address.
core.Address address = 1;
// Opaque and implementation dependent metadata of the
// endpoint. Envoy will pass this directly to the management server.
google.protobuf.Struct metadata = 6;
// The total number of requests successfully completed by the endpoint. A
// single HTTP or gRPC request or stream is counted as one request. A TCP
// connection is also treated as one request. There is no explicit

Loading…
Cancel
Save