metadata.proto 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. syntax = "proto3";
  2. package envoy.extensions.formatter.metadata.v3;
  3. import "udpa/annotations/status.proto";
  4. option java_package = "io.envoyproxy.envoy.extensions.formatter.metadata.v3";
  5. option java_outer_classname = "MetadataProto";
  6. option java_multiple_files = true;
  7. option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/formatter/metadata/v3;metadatav3";
  8. option (udpa.annotations.file_status).package_version_status = ACTIVE;
  9. // [#protodoc-title: Formatter extension for printing various types of metadata]
  10. // [#extension: envoy.formatter.metadata]
  11. // Metadata formatter extension implements METADATA command operator that
  12. // prints all types of metadata. The first parameter taken by METADATA operator defines
  13. // type of metadata. The following types of metadata are supported (case sensitive):
  14. //
  15. // * DYNAMIC
  16. // * CLUSTER
  17. // * ROUTE
  18. //
  19. // See :ref:`here <config_access_log>` for more information on access log configuration.
  20. // %METADATA(TYPE:NAMESPACE:KEY):Z%
  21. // :ref:`Metadata <envoy_v3_api_msg_config.core.v3.Metadata>` info,
  22. // where TYPE is type of metadata (see above for supported types),
  23. // NAMESPACE is the filter namespace used when setting the metadata, KEY is an optional
  24. // lookup key in the namespace with the option of specifying nested keys separated by ':',
  25. // and Z is an optional parameter denoting string truncation up to Z characters long.
  26. // The data will be logged as a JSON string. For example, for the following ROUTE metadata:
  27. //
  28. // ``com.test.my_filter: {"test_key": "foo", "test_object": {"inner_key": "bar"}}``
  29. //
  30. // * %METADATA(ROUTE:com.test.my_filter)% will log: ``{"test_key": "foo", "test_object": {"inner_key": "bar"}}``
  31. // * %METADATA(ROUTE:com.test.my_filter:test_key)% will log: ``foo``
  32. // * %METADATA(ROUTE:com.test.my_filter:test_object)% will log: ``{"inner_key": "bar"}``
  33. // * %METADATA(ROUTE:com.test.my_filter:test_object:inner_key)% will log: ``bar``
  34. // * %METADATA(ROUTE:com.unknown_filter)% will log: ``-``
  35. // * %METADATA(ROUTE:com.test.my_filter:unknown_key)% will log: ``-``
  36. // * %METADATA(ROUTE:com.test.my_filter):25% will log (truncation at 25 characters): ``{"test_key": "foo", "test``
  37. //
  38. // .. note::
  39. //
  40. // For typed JSON logs, this operator renders a single value with string, numeric, or boolean type
  41. // when the referenced key is a simple value. If the referenced key is a struct or list value, a
  42. // JSON struct or list is rendered. Structs and lists may be nested. In any event, the maximum
  43. // length is ignored.
  44. //
  45. // .. note::
  46. //
  47. // METADATA(DYNAMIC:NAMESPACE:KEY):Z is equivalent to :ref:`DYNAMIC_METADATA(NAMESPACE:KEY):Z<config_access_log_format_dynamic_metadata>`
  48. // METADATA(CLUSTER:NAMESPACE:KEY):Z is equivalent to :ref:`CLUSTER_METADATA(NAMASPACE:KEY):Z<config_access_log_format_cluster_metadata>`
  49. message Metadata {
  50. }