Skip to content

Commit

Permalink
api: Add a metadata field to UpstreamEndpointStats. (envoyproxy#5154)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
karthikbox authored and mattklein123 committed Dec 4, 2018
1 parent c97eb9f commit 8d8cb4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/envoy/api/v2/endpoint/load_report.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8d8cb4a

Please sign in to comment.