Skip to content

Commit 796e47e

Browse files
committed
init trace for controller
all components want to propagate SpanContext via http header are required to init trace. Otherwise, RoundTrip will start a noopSpan which will override the origin span, then it causes the origin span(SpanContext) lost Signed-off-by: Li Zhijian <[email protected]>
1 parent d289379 commit 796e47e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/kube-controller-manager/controller-manager.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"k8s.io/component-base/logs"
2929
_ "k8s.io/component-base/metrics/prometheus/clientgo" // load all the prometheus client-go plugin
3030
_ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration
31+
"k8s.io/component-base/traces"
3132
"k8s.io/kubernetes/cmd/kube-controller-manager/app"
3233
)
3334

@@ -43,6 +44,8 @@ func main() {
4344
logs.InitLogs()
4445
defer logs.FlushLogs()
4546

47+
// TODO: initTraces only if feature gate ObjectTraceIDs is enabled
48+
traces.InitTraces("kube-controller-manage")
4649
if err := command.Execute(); err != nil {
4750
os.Exit(1)
4851
}

0 commit comments

Comments
 (0)