package metadatav3

import "github.com/envoyproxy/go-control-plane/envoy/extensions/formatter/metadata/v3"

Index

Variables

var File_envoy_extensions_formatter_metadata_v3_metadata_proto protoreflect.FileDescriptor

Types

type Metadata

type Metadata struct {
	// contains filtered or unexported fields
}

%METADATA(TYPE:NAMESPACE:KEY):Z%

  :ref:`Metadata <envoy_v3_api_msg_config.core.v3.Metadata>` info,
  where TYPE is type of metadata (see above for supported types),
  NAMESPACE is the filter namespace used when setting the metadata, KEY is an optional
  lookup key in the namespace with the option of specifying nested keys separated by ':',
  and Z is an optional parameter denoting string truncation up to Z characters long.
  The data will be logged as a JSON string. For example, for the following ROUTE metadata:

  ``com.test.my_filter: {"test_key": "foo", "test_object": {"inner_key": "bar"}}``

  * %METADATA(ROUTE:com.test.my_filter)% will log: ``{"test_key": "foo", "test_object": {"inner_key": "bar"}}``
  * %METADATA(ROUTE:com.test.my_filter:test_key)% will log: ``foo``
  * %METADATA(ROUTE:com.test.my_filter:test_object)% will log: ``{"inner_key": "bar"}``
  * %METADATA(ROUTE:com.test.my_filter:test_object:inner_key)% will log: ``bar``
  * %METADATA(ROUTE:com.unknown_filter)% will log: ``-``
  * %METADATA(ROUTE:com.test.my_filter:unknown_key)% will log: ``-``
  * %METADATA(ROUTE:com.test.my_filter):25% will log (truncation at 25 characters): ``{"test_key": "foo", "test``

.. note::

  For typed JSON logs, this operator renders a single value with string, numeric, or boolean type
  when the referenced key is a simple value. If the referenced key is a struct or list value, a
  JSON struct or list is rendered. Structs and lists may be nested. In any event, the maximum
  length is ignored.

.. note::

  METADATA(DYNAMIC:NAMESPACE:KEY):Z is equivalent to :ref:`DYNAMIC_METADATA(NAMESPACE:KEY):Z<config_access_log_format_dynamic_metadata>`
  METADATA(CLUSTER:NAMESPACE:KEY):Z is equivalent to :ref:`CLUSTER_METADATA(NAMESPACE:KEY):Z<config_access_log_format_cluster_metadata>`
  METADATA(UPSTREAM_HOST:NAMESPACE:KEY):Z is equivalent to :ref:`UPSTREAM_METADATA(NAMESPACE:KEY):Z<config_access_log_format_upstream_host_metadata>`

.. warning::

This extension is treated as built-in extension and will be enabled by default now.
It is unnecessary to configure this extension.

func (*Metadata) Descriptor

func (*Metadata) Descriptor() ([]byte, []int)

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect

func (x *Metadata) ProtoReflect() protoreflect.Message

func (*Metadata) Reset

func (x *Metadata) Reset()

func (*Metadata) String

func (x *Metadata) String() string

func (*Metadata) Validate

func (m *Metadata) Validate() error

Validate checks the field values on Metadata with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Metadata) ValidateAll

func (m *Metadata) ValidateAll() error

ValidateAll checks the field values on Metadata with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in MetadataMultiError, or nil if none found.

type MetadataMultiError

type MetadataMultiError []error

MetadataMultiError is an error wrapping multiple validation errors returned by Metadata.ValidateAll() if the designated constraints aren't met.

func (MetadataMultiError) AllErrors

func (m MetadataMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MetadataMultiError) Error

func (m MetadataMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type MetadataValidationError

type MetadataValidationError struct {
	// contains filtered or unexported fields
}

MetadataValidationError is the validation error returned by Metadata.Validate if the designated constraints aren't met.

func (MetadataValidationError) Cause

func (e MetadataValidationError) Cause() error

Cause function returns cause value.

func (MetadataValidationError) Error

func (e MetadataValidationError) Error() string

Error satisfies the builtin error interface

func (MetadataValidationError) ErrorName

func (e MetadataValidationError) ErrorName() string

ErrorName returns error name.

func (MetadataValidationError) Field

func (e MetadataValidationError) Field() string

Field function returns field value.

func (MetadataValidationError) Key

func (e MetadataValidationError) Key() bool

Key function returns key value.

func (MetadataValidationError) Reason

func (e MetadataValidationError) Reason() string

Reason function returns reason value.

Source Files

metadata.pb.go metadata.pb.validate.go

Version
v1.37.0 (latest)
Published
Jan 13, 2026
Platform
linux/amd64
Imports
18 packages
Last checked
1 hour ago

Tools for package owners.