Skip to content

Commit

Permalink
add to cluster-admin/system-traces docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sallyom committed Aug 9, 2022
1 parent e7edb6e commit 16f1237
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions content/en/docs/concepts/cluster-administration/system-traces.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ weight: 60

<!-- overview -->

{{< feature-state for_k8s_version="v1.22" state="alpha" >}}
{{< feature-state for_k8s_version="v1.22, kube-apiserver" state="alpha" >}}
{{< feature-state for_k8s_version="v1.25, kubelet" state="alpha" >}}

System component traces record the latency of and relationships between operations in the cluster.

Expand Down Expand Up @@ -61,7 +62,7 @@ as the kube-apiserver is often a public endpoint.
To enable tracing, enable the `APIServerTracing`
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
on the kube-apiserver. Also, provide the kube-apiserver with a tracing configration file
on the kube-apiserver. Also, provide the kube-apiserver with a tracing configuration file
with `--tracing-config-file=<path-to-config>`. This is an example config that records
spans for 1 in 10000 requests, and uses the default OpenTelemetry endpoint:

Expand All @@ -76,6 +77,30 @@ samplingRatePerMillion: 100
For more information about the `TracingConfiguration` struct, see
[API server config API (v1alpha1)](/docs/reference/config-api/apiserver-config.v1alpha1/#apiserver-k8s-io-v1alpha1-TracingConfiguration).

### kubelet traces

The kubelet CRI interface and authenticated http servers are instrumented to generate
trace spans. As with the apiserver, the endpoint and sampling rate are configurable.
Trace context propagation is also configured.

#### Enabling tracing in the kubelet

To enable tracing, enable the `KubeletTracing`
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
on the kubelet. Also, provide the kubelet with a
[tracing configuration](https://github.com/kubernetes/component-base/blob/master/tracing/api/v1/types.go).
This is an example snippet of a kubelet config that records spans for 1 in 10000 requests, and uses the default OpenTelemetry endpoint:

```yaml
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
featureGates:
KubeletTracing: true
tracing:
endpoint: 127.0.0.1:4317
samplingRatePerMillion: 100
```

## Stability

Tracing instrumentation is still under active development, and may change
Expand Down

0 comments on commit 16f1237

Please sign in to comment.