Skip to content

Commit

Permalink
Merge pull request kubernetes#115750 from saschagrunert/otel-beta
Browse files Browse the repository at this point in the history
Graduate `KubeletTracing` feature to beta
  • Loading branch information
k8s-ci-robot committed Mar 14, 2023
2 parents 98b1980 + a28385e commit 1586138
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/kubelet/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ func newTracerProvider(s *options.KubeletServer) (oteltrace.TracerProvider, erro
}
hostname, err := nodeutil.GetHostname(s.HostnameOverride)
if err != nil {
return nil, fmt.Errorf("could not determine hostname for tracer provider: %v", err)
return nil, fmt.Errorf("could not determine hostname for tracer provider: %w", err)
}
resourceOpts := []otelsdkresource.Option{
otelsdkresource.WithAttributes(
Expand All @@ -1290,7 +1290,7 @@ func newTracerProvider(s *options.KubeletServer) (oteltrace.TracerProvider, erro
}
tp, err := tracing.NewProvider(context.Background(), s.KubeletConfiguration.Tracing, []otlptracegrpc.Option{}, resourceOpts)
if err != nil {
return nil, fmt.Errorf("could not configure tracer provider: %v", err)
return nil, fmt.Errorf("could not configure tracer provider: %w", err)
}
return tp, nil
}
3 changes: 2 additions & 1 deletion hack/local-up-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ STORAGE_BACKEND=${STORAGE_BACKEND:-"etcd3"}
STORAGE_MEDIA_TYPE=${STORAGE_MEDIA_TYPE:-"application/vnd.kubernetes.protobuf"}
# preserve etcd data. you also need to set ETCD_DIR.
PRESERVE_ETCD="${PRESERVE_ETCD:-false}"
ENABLE_TRACING=${ENABLE_TRACING:-false}

# enable Kubernetes-CSI snapshotter
ENABLE_CSI_SNAPSHOTTER=${ENABLE_CSI_SNAPSHOTTER:-false}
Expand Down Expand Up @@ -753,7 +754,7 @@ staticPodPath: "${POD_MANIFEST_PATH}"
resolvConf: "${KUBELET_RESOLV_CONF}"
EOF

if [[ "$FEATURE_GATES" == *KubeletTracing=true* ]]; then
if [[ "$ENABLE_TRACING" = true ]]; then
cat <<EOF >> "${TMP_DIR}"/kubelet.yaml
tracing:
endpoint: localhost:4317 # the default value
Expand Down
3 changes: 2 additions & 1 deletion pkg/features/kube_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ const (
// owner: @sallyom
// kep: https://kep.k8s.io/2832
// alpha: v1.25
// beta: v1.27
//
// Add support for distributed tracing in the kubelet
KubeletTracing featuregate.Feature = "KubeletTracing"
Expand Down Expand Up @@ -1013,7 +1014,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS

KubeletPodResourcesGetAllocatable: {Default: true, PreRelease: featuregate.Beta},

KubeletTracing: {Default: false, PreRelease: featuregate.Alpha},
KubeletTracing: {Default: true, PreRelease: featuregate.Beta},

LegacyServiceAccountTokenNoAutoGeneration: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.29

Expand Down
2 changes: 1 addition & 1 deletion pkg/generated/openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions staging/src/k8s.io/kubelet/config/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ type KubeletConfiguration struct {
RegisterNode *bool `json:"registerNode,omitempty"`
// Tracing specifies the versioned configuration for OpenTelemetry tracing clients.
// See https://kep.k8s.io/2832 for more details.
// Default: nil
// +featureGate=KubeletTracing
// +optional
Tracing *tracingapi.TracingConfiguration `json:"tracing,omitempty"`
Expand Down

0 comments on commit 1586138

Please sign in to comment.