--- WARNING: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT. PLEASE MODIFY THE ORIGINAL SOURCE IN THE 'https://github.com/istio/proxy' REPO source_repo: https://github.com/istio/proxy title: AttributeGen Config description: Configuration for Attribute Generation plugin. location: https://istio.io/docs/reference/config/proxy_extensions/attributegen.html layout: protoc-gen-docs generator: protoc-gen-docs schema: istio.attributegen weight: 20 number_of_entries: 3 ---
AttributeGen plugin uses builtin attributes as inputs and produces new attributes that can be used by downstream plugins.
The following is an example of a configuration that produces one attribute
named istio_operationId
using request.url_path
and request.method
.
{{
{
"attributes": [
{
"output_attribute": "istio_operationId",
"match": [
{
"value": "ListBooks",
"condition": "request.url_path == '/books' && request.method ==
'GET'"
},
{
"value": "GetBook",
"condition":
"request.url_path.matches('^/shelves/[[:alnum:]]*/books/[[:alnum:]]*$')
&& request.method == 'GET'"
},
{
"value": "CreateBook",
"condition": "request.url_path == '/books/' && request.method ==
'POST'"
}
]
}
]
}
{{}} {{}}
If the Stats plugin runs after AttributeGen, it can use istio_operationId
to populate a dimension on a metric.
The following is an example of response codes being mapped into a smaller
number of response classes as the istio_responseClass
attribute. For
example, all response codes in 200s are mapped to 2xx
.
{{
{
"attributes": [
{
"output_attribute": "istio_responseClass",
"match": [
{
"value": "2xx",
"condition": "response.code >= 200 && response.code <= 299"
},
{
"value": "3xx",
"condition": "response.code >= 300 && response.code <= 399"
},
{
"value": "404",
"condition": "response.code == 404"
},
{
"value": "429",
"condition": "response.code == 429"
},
{
"value": "503",
"condition": "response.code == 503"
},
{
"value": "5xx",
"condition": "response.code >= 500 && response.code <= 599"
},
{
"value": "4xx",
"condition": "response.code >= 400 && response.code <= 499"
}
]
}
]
}
{{}} {{}}
If multiple AttributeGene configurations produce the same attribute, the result of the last configuration will be visible to downstream filters.
AttributeGeneration define generation of one attribute.
If the condition evaluates to true then the Match returns the specified value.
Top level configuration to generate new attributes based on attributes of the proxied traffic.