Skip to content

Commit

Permalink
feat: Enhance the AttributeContext semantics, and other comments update.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 355883280
  • Loading branch information
Google APIs authored and copybara-github committed Feb 5, 2021
1 parent 531abbd commit 7f6e0d5
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
2 changes: 2 additions & 0 deletions google/rpc/context/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ proto_library(
],
deps = [
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
],
Expand Down Expand Up @@ -65,6 +66,7 @@ moved_proto_library(
srcs = [":attribute_context_proto"],
deps = [
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
],
Expand Down
56 changes: 54 additions & 2 deletions google/rpc/context/attribute_context.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ syntax = "proto3";
package google.rpc.context;

import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

Expand Down Expand Up @@ -182,7 +183,7 @@ message AttributeContext {
// appears in the first line of the HTTP request. No decoding is performed.
string query = 7;

// The timestamp when the `destination` service receives the first byte of
// The timestamp when the `destination` service receives the last byte of
// the request.
google.protobuf.Timestamp time = 9;

Expand Down Expand Up @@ -218,9 +219,15 @@ message AttributeContext {
// lowercased, because HTTP header keys are case-insensitive.
map<string, string> headers = 3;

// The timestamp when the `destination` service generates the first byte of
// The timestamp when the `destination` service sends the last byte of
// the response.
google.protobuf.Timestamp time = 4;

// The length of time it takes the backend service to fully respond to a
// request. Measured from when the destination service starts to send the
// request to the backend until when the destination service receives the
// complete response from the backend.
google.protobuf.Duration backend_latency = 5;
}

// This message defines core attributes for a resource. A resource is an
Expand Down Expand Up @@ -255,6 +262,51 @@ message AttributeContext {
// The labels or tags on the resource, such as AWS resource tags and
// Kubernetes resource labels.
map<string, string> labels = 4;

// The unique identifier of the resource. UID is unique in the time
// and space for this resource within the scope of the service. It is
// typically generated by the server on successful creation of a resource
// and must not be changed. UID is used to uniquely identify resources
// with resource name reuses. This should be a UUID4.
string uid = 5;

// Annotations is an unstructured key-value map stored with a resource that
// may be set by external tools to store and retrieve arbitrary metadata.
// They are not queryable and should be preserved when modifying objects.
//
// More info: https://kubernetes.io/docs/user-guide/annotations
map<string, string> annotations = 6;

// Mutable. The display name set by clients. Must be <= 63 characters.
string display_name = 7;

// Output only. The timestamp when the resource was created. This may
// be either the time creation was initiated or when it was completed.
google.protobuf.Timestamp create_time = 8;

// Output only. The timestamp when the resource was last updated. Any
// change to the resource made by users must refresh this value.
// Changes to a resource made by the service should refresh this value.
google.protobuf.Timestamp update_time = 9;

// Output only. The timestamp when the resource was deleted.
// If the resource is not deleted, this must be empty.
google.protobuf.Timestamp delete_time = 10;

// Output only. An opaque value that uniquely identifies a version or
// generation of a resource. It can be used to confirm that the client
// and server agree on the ordering of a resource being written.
string etag = 11;

// Immutable. The location of the resource. The location encoding is
// specific to the service provider, and new encoding may be introduced
// as the service evolves.
//
// For Google Cloud products, the encoding is what is used by Google Cloud
// APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The
// semantics of `location` is identical to the
// `cloud.googleapis.com/location` label used by some Google Cloud APIs.
string location = 12;
}

// The origin of a network activity. In a multi hop network activity,
Expand Down

0 comments on commit 7f6e0d5

Please sign in to comment.