Metadata (proto)

type.metadata.v3.MetadataKey

[type.metadata.v3.MetadataKey proto]

MetadataKey provides a way to retrieve values from Metadata using a key and a path.

For example, consider the following Metadata:

filter_metadata:
  envoy.xxx:
    prop:
      foo: bar
      xyz:
        hello: envoy

The following MetadataKey would retrieve the string value “bar” from the Metadata:

key: envoy.xxx
path:
- key: prop
- key: foo
{
  "key": ...,
  "path": []
}
key

(string, REQUIRED) The key name of the Metadata from which to retrieve the Struct. This typically represents a builtin subsystem or custom extension.

path

(repeated type.metadata.v3.MetadataKey.PathSegment, REQUIRED) The path used to retrieve a specific Value from the Struct. This can be either a prefix or a full path, depending on the use case. For example, [{key: prop}, {key: xyz}] would retrieve a struct or [{key: prop}, {key: foo}] would retrieve a string in the example above.

Path segments support both struct field access (via key) and list element access (via index). For example, to access the first element of a list at envoy.filters.http.grpc_field_extraction.tenant_id, use path: [{key: tenant_id}, {index: 0}].

type.metadata.v3.MetadataKey.PathSegment

[type.metadata.v3.MetadataKey.PathSegment proto]

Specifies a segment in a path for retrieving values from Metadata. Supports both key-based segments (field names in a Struct) and index-based segments (element access in a ListValue).

{
  "key": ...,
  "index": ...
}
key

(string) If specified, use this key to retrieve the value in a Struct.

Precisely one of key, index must be set.

index

(uint32) If specified, use this index to retrieve a value from a ListValue.

Precisely one of key, index must be set.

type.metadata.v3.MetadataKind

[type.metadata.v3.MetadataKind proto]

Describes different types of metadata sources.

{
  "request": {...},
  "route": {...},
  "cluster": {...},
  "host": {...}
}
request

(type.metadata.v3.MetadataKind.Request) Request kind of metadata.

Precisely one of request, route, cluster, host must be set.

route

(type.metadata.v3.MetadataKind.Route) Route kind of metadata.

Precisely one of request, route, cluster, host must be set.

cluster

(type.metadata.v3.MetadataKind.Cluster) Cluster kind of metadata.

Precisely one of request, route, cluster, host must be set.

host

(type.metadata.v3.MetadataKind.Host) Host kind of metadata.

Precisely one of request, route, cluster, host must be set.

type.metadata.v3.MetadataKind.Request

[type.metadata.v3.MetadataKind.Request proto]

Represents dynamic metadata associated with the request.

type.metadata.v3.MetadataKind.Route

[type.metadata.v3.MetadataKind.Route proto]

Represents metadata from the route.

type.metadata.v3.MetadataKind.Cluster

[type.metadata.v3.MetadataKind.Cluster proto]

Represents metadata from the upstream cluster.

type.metadata.v3.MetadataKind.Host

[type.metadata.v3.MetadataKind.Host proto]

Represents metadata from the upstream host.