Skip to content

Add support for OpenTelemetry traces #1317

@saschagrunert

Description

@saschagrunert

We're calling the runtime and image service setup from the kubelet in:

res, err = remote.NewRemoteRuntimeService(endPoint, t, nil)

return remote.NewRemoteRuntimeService(RuntimeEndpoint, t, nil)

res, err = remote.NewRemoteImageService(endPoint, Timeout, nil)

return remote.NewRemoteImageService(ImageEndpoint, Timeout, nil)

but we always pass a nil tracer provider to the service, which could be something to support OTEL in crictl.

The kubelet feature itself is enabled by default:

if utilfeature.DefaultFeatureGate.Enabled(features.KubeletTracing) {
tracingOpts := []otelgrpc.Option{
otelgrpc.WithPropagators(tracing.Propagators()),
otelgrpc.WithTracerProvider(tp),
}
// Even if there is no TracerProvider, the otelgrpc still handles context propagation.
// See https://github.com/open-telemetry/opentelemetry-go/tree/main/example/passthrough
dialOpts = append(dialOpts,
grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor(tracingOpts...)),
grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor(tracingOpts...)))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions