update doc for classify metrics (#8339)

This commit is contained in:
Xinnan Wen 2020-10-26 10:00:25 -07:00 committed by GitHub
parent e9322e69dc
commit b74e42ced1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 20 deletions

View File

@ -66,7 +66,7 @@ spec:
match: match:
context: SIDECAR_INBOUND context: SIDECAR_INBOUND
proxy: proxy:
proxyVersion: '1\.6.*' proxyVersion: '1\.8.*'
listener: listener:
filterChain: filterChain:
filter: filter:
@ -82,7 +82,9 @@ spec:
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
value: value:
config: config:
configuration: | configuration:
"@type": type.googleapis.com/google.protobuf.StringValue
value: |
{ {
"attributes": [ "attributes": [
{ {
@ -116,22 +118,22 @@ spec:
$ kubectl -n istio-system apply -f attribute_gen_service.yaml $ kubectl -n istio-system apply -f attribute_gen_service.yaml
{{< /text >}} {{< /text >}}
1. Find the `stats-filter-1.6` `EnvoyFilter` resource from the `istio-system` 1. Find the `stats-filter-1.8` `EnvoyFilter` resource from the `istio-system`
namespace, using the following command: namespace, using the following command:
{{< text bash >}} {{< text bash >}}
$ kubectl -n istio-system get envoyfilter | grep ^stats-filter-1.6 $ kubectl -n istio-system get envoyfilter | grep ^stats-filter-1.8
stats-filter-1.6 2d stats-filter-1.8 2d
{{< /text >}} {{< /text >}}
1. Create a local file system copy of the `EnvoyFilter` configuration, using the 1. Create a local file system copy of the `EnvoyFilter` configuration, using the
following command: following command:
{{< text bash >}} {{< text bash >}}
$ kubectl -n istio-system get envoyfilter stats-filter-1.6 -o yaml > stats-filter-1.6.yaml $ kubectl -n istio-system get envoyfilter stats-filter-1.8 -o yaml > stats-filter-1.8.yaml
{{< /text >}} {{< /text >}}
1. Open `stats-filter-1.6.yaml` with a text editor and locate the 1. Open `stats-filter-1.8.yaml` with a text editor and locate the
`name: istio.stats` extension configuration. Update it to map `request_operation` `name: istio.stats` extension configuration. Update it to map `request_operation`
dimension in the `requests_total` standard metric to `istio_operationId` attribute. dimension in the `requests_total` standard metric to `istio_operationId` attribute.
The updated configuration file section should look like the following. The updated configuration file section should look like the following.
@ -143,7 +145,9 @@ spec:
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
value: value:
config: config:
configuration: > configuration:
"@type": type.googleapis.com/google.protobuf.StringValue
value: |
{ {
"debug": "true", "debug": "true",
"stat_prefix": "istio", "stat_prefix": "istio",
@ -157,10 +161,10 @@ spec:
} }
{{< /text >}} {{< /text >}}
1. Save `stats-filter-1.6.yaml` and then apply the configuration using the following command: 1. Save `stats-filter-1.8.yaml` and then apply the configuration using the following command:
{{< text bash >}} {{< text bash >}}
$ kubectl -n istio-system apply -f stats-filter-1.6.yaml $ kubectl -n istio-system apply -f stats-filter-1.8.yaml
{{< /text >}} {{< /text >}}
1. Generate metrics by sending traffic to your application. 1. Generate metrics by sending traffic to your application.
@ -194,7 +198,7 @@ spec:
match: match:
context: SIDECAR_INBOUND context: SIDECAR_INBOUND
proxy: proxy:
proxyVersion: '1\.6.*' proxyVersion: '1\.8.*'
listener: listener:
filterChain: filterChain:
filter: filter:
@ -210,7 +214,9 @@ spec:
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
value: value:
config: config:
configuration: > configuration:
"@type": type.googleapis.com/google.protobuf.StringValue
value: |
{ {
"attributes": [ "attributes": [
{ {
@ -260,22 +266,22 @@ spec:
$ kubectl -n istio-system apply -f attribute_gen_service.yaml $ kubectl -n istio-system apply -f attribute_gen_service.yaml
{{< /text >}} {{< /text >}}
1. Find the `stats-filter-1.6` `EnvoyFilter` resource from the `istio-system` 1. Find the `stats-filter-1.8` `EnvoyFilter` resource from the `istio-system`
namespace, using the following command: namespace, using the following command:
{{< text bash >}} {{< text bash >}}
$ kubectl -n istio-system get envoyfilter | grep ^stats-filter-1.6 $ kubectl -n istio-system get envoyfilter | grep ^stats-filter-1.8
stats-filter-1.6 2d stats-filter-1.8 2d
{{< /text >}} {{< /text >}}
1. Create a local file system copy of the `EnvoyFilter` configuration, using the 1. Create a local file system copy of the `EnvoyFilter` configuration, using the
following command: following command:
{{< text bash >}} {{< text bash >}}
$ kubectl -n istio-system get envoyfilter stats-filter-1.6 -o yaml > stats-filter-1.6.yaml $ kubectl -n istio-system get envoyfilter stats-filter-1.8 -o yaml > stats-filter-1.8.yaml
{{< /text >}} {{< /text >}}
1. Open `stats-filter-1.6.yaml` with a text editor and locate the 1. Open `stats-filter-1.8.yaml` with a text editor and locate the
`name: istio.stats` extension configuration. Update it to map `response_code` `name: istio.stats` extension configuration. Update it to map `response_code`
dimension in the `requests_total` standard metric to `istio_responseClass` attribute. dimension in the `requests_total` standard metric to `istio_responseClass` attribute.
The updated configuration file section should look like the following. The updated configuration file section should look like the following.
@ -287,7 +293,9 @@ spec:
type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
value: value:
config: config:
configuration: > configuration:
"@type": type.googleapis.com/google.protobuf.StringValue
value: |
{ {
"debug": "true", "debug": "true",
"stat_prefix": "istio", "stat_prefix": "istio",
@ -301,10 +309,10 @@ spec:
} }
{{< /text >}} {{< /text >}}
1. Save `stats-filter-1.6.yaml` and then apply the configuration using the following command: 1. Save `stats-filter-1.8.yaml` and then apply the configuration using the following command:
{{< text bash >}} {{< text bash >}}
$ kubectl -n istio-system apply -f stats-filter-1.6.yaml $ kubectl -n istio-system apply -f stats-filter-1.8.yaml
{{< /text >}} {{< /text >}}
## Verify the results ## Verify the results