zh-translation:content/zh/docs/ops/telemetry/envoy-stats/index.md (#5347)

This commit is contained in:
zzzhy 2019-11-05 21:40:44 +08:00 committed by Istio Automation
parent 75e48d62fe
commit d9faef9f2f
1 changed files with 19 additions and 24 deletions

View File

@ -1,28 +1,26 @@
---
title: Envoy Statistics
description: Fine-grained control of Envoy statistics.
title: Envoy 的统计信息
description: 精细化控制 Envoy 的统计信息。
weight: 95
aliases:
- /help/ops/telemetry/envoy-stats
---
The Envoy proxy keeps detailed statistics about network traffic.
Envoy 代理收集保留了关于网络流量的详细统计信息。
Envoy's statistics only cover the traffic for a particular Envoy instance. See
[Observability](/docs/tasks/observability/) for persistent per-service Istio telemetry. The
statistics the Envoy proxies record can provide more information about specific pod instances.
Envoy 的统计信息只覆盖了特定 Envoy 实例的流量。参考 [可观测性](/zh/docs/tasks/observability/)
了解关于服务级别的 Istio 遥测方面的内容。这些由 Envoy 代理产生的统计数据记录能够提供更多关于 pod 实例的具体信息。
To see the statistics for a pod:
查看某个 pod 的统计信息:
{{< text bash >}}
$ kubectl exec $POD -c istio-proxy -- pilot-agent request GET stats
{{< /text >}}
See [the Envoy documentation](https://www.envoyproxy.io/docs/envoy/latest/configuration/upstream/cluster_manager/cluster_stats)
for an explanation of the data recorded.
参考 [Envoy 文档](https://www.envoyproxy.io/docs/envoy/latest/configuration/upstream/cluster_manager/cluster_stats)
了解更多有关于这些记录数据的解释。
By default, Istio configures Envoy to record minimal statistics. The default collection
keys are:
Istio 默认配置下 Envoy 只会记录最小化的统计信息。缺省的关键词集合有:
- `cluster_manager`
- `listener_manager`
@ -31,19 +29,16 @@ keys are:
- `server`
- `cluster.xds-grpc`
To see the Envoy settings for statistics data collection use
[`istioctl proxy-config bootstrap`](/docs/reference/commands/istioctl/#istioctl-proxy-config-bootstrap) and follow the
[deep dive into Envoy configuration](/docs/ops/diagnostic-tools/proxy-cmd/#deep-dive-into-envoy-configuration).
Envoy only collects statistical data on items matching the `inclusion_list` within
the `stats_matcher` JSON element.
要查看关于统计数据收集的 Envoy 配置,可以使用
[`istioctl proxy-config bootstrap`](/zh/docs/reference/commands/istioctl/#istioctl-proxy-config-bootstrap) 命令,还可以参考
[深入研究 Envoy 配置](/zh/docs/ops/diagnostic-tools/proxy-cmd/#deep-dive-into-envoy-configuration) 更加深入的了解相关的配置。
需要注意的是, 只有那些 `stats_matcher` JSON 字段能匹配上 `inclusion_list` 的元件Envoy 才会去收集他们的统计数据。
To Configure Envoy to record statistics for inbound or outbound traffic, add the
`sidecar.istio.io/statsInclusionPrefixes` annotation to the pod template in the Kubernetes `Deployment`.
Add the `cluster.outbound` prefix to gather data about outbound traffic activity and circuit breaking.
To gather data on inbound traffic, add the `listener` prefix. The sample
[fortio-deploy.yaml]({{< github_file>}}/samples/httpbin/sample-client/fortio-deploy.yaml)
shows use of `sidecar.istio.io/statsInclusionPrefixes` with the `cluster.outbound` prefix.
要想让 Envoy 去收集出站和入站流量的统计信息,只需将 `sidecar.istio.io/statsInclusionPrefixes` 注解加到 Kubernetes `Deployment` 的 pod 模板里去。
在模板里加上 `cluster.outbound` 前缀就能统计出站流量活动和熔断事件的数据, 相似,如果要收集入站流量的数据,只需加上 `listener` 前缀。
这个例子 [fortio-deploy.yaml]({{< github_file>}}/samples/httpbin/sample-client/fortio-deploy.yaml) 中用 `cluster.outbound`
前缀展示了 `sidecar.istio.io/statsInclusionPrefixes` 的用法。
You can override the Envoy defaults to gather less data than usual. Use
你可以通过覆盖 Envoy 的默认配置去收集比通常更少的数据。比如可以使用
`sidecar.istio.io/statsInclusionPrefixes: cluster_manager,listener_manager`
to collect the least statistics possible.
去收集尽可能少的统计数据。