Skip to content

Commit 781546d

Browse files
authored
Merge pull request #36220 from windsonsea/systra
[zh-cn] sync1.25 /cluster-administration/system-traces.md
2 parents bef3a43 + 21435dc commit 781546d

File tree

1 file changed

+51
-7
lines changed

1 file changed

+51
-7
lines changed

content/zh-cn/docs/concepts/cluster-administration/system-traces.md

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ content_type: concept
44
weight: 60
55
---
66
<!--
7-
---
87
title: Traces For Kubernetes System Components
98
reviewers:
109
- logicalhan
1110
- lilic
1211
content_type: concept
1312
weight: 60
14-
---
1513
-->
1614

1715
<!-- overview -->
@@ -59,7 +57,7 @@ the following receiver configuration will collect spans and log them to standard
5957
-->
6058
默认情况下,Kubernetes 组件使用 gRPC 的 OTLP 导出器来导出追踪信息,将信息写到
6159
[IANA OpenTelemetry 端口](https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=opentelemetry)
62-
举例来说,如果收集器以 Kubernetes 组件的边车模式运行,以下接收器配置会收集 spans 信息,并将它们写入到标准输出。
60+
举例来说,如果收集器以 Kubernetes 组件的边车模式运行,以下接收器配置会收集 span 信息,并将它们写入到标准输出。
6361

6462
<!--
6563
# Replace this exporter with the exporter for your backend
@@ -96,7 +94,7 @@ to webhooks, etcd, and re-entrant requests. It propagates the
9694
but does not make use of the trace context attached to incoming requests,
9795
as the kube-apiserver is often a public endpoint.
9896
-->
99-
kube-apiserver 为传入的 HTTP 请求、传出到 webhook 和 etcd 的请求以及重入的请求生成 spans
97+
kube-apiserver 为传入的 HTTP 请求、传出到 webhook 和 etcd 的请求以及重入的请求生成 span
10098
由于 kube-apiserver 通常是一个公开的端点,所以它通过出站的请求传播
10199
[W3C 追踪上下文](https://www.w3.org/TR/trace-context/),
102100
但不使用入站请求的追踪上下文。
@@ -109,7 +107,7 @@ kube-apiserver 为传入的 HTTP 请求、传出到 webhook 和 etcd 的请求
109107
<!--
110108
To enable tracing, enable the `APIServerTracing`
111109
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
112-
on the kube-apiserver. Also, provide the kube-apiserver with a tracing configration file
110+
on the kube-apiserver. Also, provide the kube-apiserver with a tracing configuration file
113111
with `--tracing-config-file=<path-to-config>`. This is an example config that records
114112
spans for 1 in 10000 requests, and uses the default OpenTelemetry endpoint:
115113
-->
@@ -130,10 +128,56 @@ samplingRatePerMillion: 100
130128
For more information about the `TracingConfiguration` struct, see
131129
[API server config API (v1alpha1)](/docs/reference/config-api/apiserver-config.v1alpha1/#apiserver-k8s-io-v1alpha1-TracingConfiguration).
132130
-->
133-
134-
有关 TracingConfiguration 结构体的更多信息,请参阅
131+
有关 TracingConfiguration 结构体的更多信息,请参阅
135132
[API 服务器配置 API (v1alpha1)](/zh-cn/docs/reference/config-api/apiserver-config.v1alpha1/#apiserver-k8s-io-v1alpha1-TracingConfiguration)。
136133

134+
<!--
135+
### kubelet traces
136+
-->
137+
### kubelet 追踪 {#kubelet-traces}
138+
139+
{{< feature-state for_k8s_version="v1.25" state="alpha" >}}
140+
141+
<!--
142+
The kubelet CRI interface and authenticated http servers are instrumented to generate
143+
trace spans. As with the apiserver, the endpoint and sampling rate are configurable.
144+
Trace context propagation is also configured. A parent span's sampling decision is always respected.
145+
A provided tracing configuration sampling rate will apply to spans without a parent.
146+
Enabled without a configured endpoint, the default OpenTelemetry Collector reciever address of "localhost:4317" is set.
147+
-->
148+
kubelet CRI 接口和实施身份验证的 HTTP 服务器被插桩以生成追踪 span。
149+
与 API 服务器一样,端点和采样率是可配置的。
150+
追踪上下文传播也是可以配置的。始终优先采用父 span 的采样决策。
151+
用户所提供的追踪配置采样率将被应用到不带父级的 span。
152+
如果在没有配置端点的情况下启用,将使用默认的 OpenTelemetry Collector 接收器地址 “localhost:4317”。
153+
154+
<!--
155+
#### Enabling tracing in the kubelet
156+
157+
To enable tracing, enable the `KubeletTracing`
158+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
159+
on the kubelet. Also, provide the kubelet with a
160+
[tracing configuration](https://github.com/kubernetes/component-base/blob/release-1.25/tracing/api/v1/types.go).
161+
This is an example snippet of a kubelet config that records spans for 1 in 10000 requests, and uses the default OpenTelemetry endpoint:
162+
-->
163+
#### 在 kubelet 中启用追踪 {#enabling-tracing-in-the-kubelet}
164+
165+
要启用 span,需在 kubelet 上启用 `KubeletTracing`
166+
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)。
167+
另外,为 kubelet 提供[追踪配置](https://github.com/kubernetes/component-base/blob/release-1.25/tracing/api/v1/types.go)。
168+
以下是 kubelet 配置的示例代码片段,每 10000 个请求中记录一个请求的 span,并使用默认的 OpenTelemetry 端点:
169+
170+
```yaml
171+
apiVersion: kubelet.config.k8s.io/v1beta1
172+
kind: KubeletConfiguration
173+
featureGates:
174+
KubeletTracing: true
175+
tracing:
176+
# 默认值
177+
#endpoint: localhost:4317
178+
samplingRatePerMillion: 100
179+
```
180+
137181
<!--
138182
## Stability
139183
-->

0 commit comments

Comments
 (0)