From b74e42ced1b466a4df314fe34478bebfc01d5a10 Mon Sep 17 00:00:00 2001 From: Xinnan Wen Date: Mon, 26 Oct 2020 10:00:25 -0700 Subject: [PATCH] update doc for classify metrics (#8339) --- .../metrics/classify-metrics/index.md | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/content/en/docs/tasks/observability/metrics/classify-metrics/index.md b/content/en/docs/tasks/observability/metrics/classify-metrics/index.md index 6ab19ece95..63a887b554 100644 --- a/content/en/docs/tasks/observability/metrics/classify-metrics/index.md +++ b/content/en/docs/tasks/observability/metrics/classify-metrics/index.md @@ -66,7 +66,7 @@ spec: match: context: SIDECAR_INBOUND proxy: - proxyVersion: '1\.6.*' + proxyVersion: '1\.8.*' listener: filterChain: filter: @@ -82,7 +82,9 @@ spec: type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm value: config: - configuration: | + configuration: + "@type": type.googleapis.com/google.protobuf.StringValue + value: | { "attributes": [ { @@ -116,22 +118,22 @@ spec: $ kubectl -n istio-system apply -f attribute_gen_service.yaml {{< /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: {{< text bash >}} - $ kubectl -n istio-system get envoyfilter | grep ^stats-filter-1.6 - stats-filter-1.6 2d + $ kubectl -n istio-system get envoyfilter | grep ^stats-filter-1.8 + stats-filter-1.8 2d {{< /text >}} 1. Create a local file system copy of the `EnvoyFilter` configuration, using the following command: {{< 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 >}} -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` dimension in the `requests_total` standard metric to `istio_operationId` attribute. 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 value: config: - configuration: > + configuration: + "@type": type.googleapis.com/google.protobuf.StringValue + value: | { "debug": "true", "stat_prefix": "istio", @@ -157,10 +161,10 @@ spec: } {{< /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 >}} - $ kubectl -n istio-system apply -f stats-filter-1.6.yaml + $ kubectl -n istio-system apply -f stats-filter-1.8.yaml {{< /text >}} 1. Generate metrics by sending traffic to your application. @@ -194,7 +198,7 @@ spec: match: context: SIDECAR_INBOUND proxy: - proxyVersion: '1\.6.*' + proxyVersion: '1\.8.*' listener: filterChain: filter: @@ -210,7 +214,9 @@ spec: type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm value: config: - configuration: > + configuration: + "@type": type.googleapis.com/google.protobuf.StringValue + value: | { "attributes": [ { @@ -260,22 +266,22 @@ spec: $ kubectl -n istio-system apply -f attribute_gen_service.yaml {{< /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: {{< text bash >}} - $ kubectl -n istio-system get envoyfilter | grep ^stats-filter-1.6 - stats-filter-1.6 2d + $ kubectl -n istio-system get envoyfilter | grep ^stats-filter-1.8 + stats-filter-1.8 2d {{< /text >}} 1. Create a local file system copy of the `EnvoyFilter` configuration, using the following command: {{< 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 >}} -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` dimension in the `requests_total` standard metric to `istio_responseClass` attribute. 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 value: config: - configuration: > + configuration: + "@type": type.googleapis.com/google.protobuf.StringValue + value: | { "debug": "true", "stat_prefix": "istio", @@ -301,10 +309,10 @@ spec: } {{< /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 >}} - $ kubectl -n istio-system apply -f stats-filter-1.6.yaml + $ kubectl -n istio-system apply -f stats-filter-1.8.yaml {{< /text >}} ## Verify the results