Metadata

    MetadataKey provides a general interface using key and path to retrieve value from Metadata.

    For example, for the following Metadata:

    The following MetadataKey will retrieve a string value “bar” from the Metadata.

    1. path:
    2. - key: prop
    3. - key: foo
    1. {
    2. "key": "...",
    3. }

    key

    (, REQUIRED) The key name of Metadata to retrieve the Struct from the metadata. Typically, it represents a builtin subsystem or custom extension.

    path

    (type.metadata.v2.MetadataKey.PathSegment, REQUIRED) The path to retrieve the Value from the Struct. It can be a prefix or a full path, e.g. [prop, xyz] for a struct or [prop, foo] for a string in the example, which depends on the particular scenario.

    Note: Due to that only the key type segment is supported, the path can not specify a list unless the list is the last segment.

    type.metadata.v2.MetadataKey.PathSegment

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

    Specifies the segment in a path to retrieve value from Metadata. Currently it is only supported to specify the key, i.e. field name, as one segment of a path.

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

    [type.metadata.v2.MetadataKind proto]

    Describes what kind of metadata.

    1. "request": "{...}",
    2. "cluster": "{...}",
    3. "host": "{...}"
    4. }

    request

    () Request kind of metadata.

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

    route

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

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

    cluster

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

    host

    () Host kind of metadata.

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

    type.metadata.v2.MetadataKind.Request

    Represents dynamic metadata associated with the request.

    1. {}

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

    Represents metadata from .

    type.metadata.v2.MetadataKind.Cluster

    Represents metadata from the upstream cluster.

    1. {}

    Represents metadata from .