From f04bb71878e6b77b5bec65565bc636ec39c6de4c Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Tue, 29 Nov 2022 13:03:13 +0100 Subject: [PATCH] Tracing: sample always in `hack/local-up-cluster.sh` If the feature gate `KubeletTracing` is enabled, then we should default to a sample rate of 1 million per million, which will sample everything: https://github.com/open-telemetry/opentelemetry-go/blob/aa868d5/sdk/trace/sampling.go#L107-L110 This helps to easier spin-up a cluster with tracing enabled by exporting `FEATURE_GATES="KubeletTracing=true"`. Related docs: https://k8s.io/docs/concepts/cluster-administration/system-traces/#kubelet-traces Signed-off-by: Sascha Grunert --- hack/local-up-cluster.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 6ec7f1ded28..20355a5074d 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -753,6 +753,15 @@ runtimeRequestTimeout: "${RUNTIME_REQUEST_TIMEOUT}" staticPodPath: "${POD_MANIFEST_PATH}" resolvConf: "${KUBELET_RESOLV_CONF}" EOF + + if [[ "$FEATURE_GATES" == *KubeletTracing=true* ]]; then + cat <> /tmp/kubelet.yaml +tracing: + endpoint: localhost:4317 # the default value + samplingRatePerMillion: 1000000 # sample always +EOF + fi + { # authentication echo "authentication:"