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 <sgrunert@redhat.com>
This commit is contained in:
Sascha Grunert 2022-11-29 13:03:13 +01:00
parent 7061704297
commit f04bb71878
No known key found for this signature in database
GPG Key ID: 09D97D153EF94D93

View File

@ -753,6 +753,15 @@ runtimeRequestTimeout: "${RUNTIME_REQUEST_TIMEOUT}"
staticPodPath: "${POD_MANIFEST_PATH}"
resolvConf: "${KUBELET_RESOLV_CONF}"
EOF
if [[ "$FEATURE_GATES" == *KubeletTracing=true* ]]; then
cat <<EOF >> /tmp/kubelet.yaml
tracing:
endpoint: localhost:4317 # the default value
samplingRatePerMillion: 1000000 # sample always
EOF
fi
{
# authentication
echo "authentication:"