MCPcopy Index your code
hub / github.com/docker/cli / createGlobalTracerProvider

Method createGlobalTracerProvider

cli/command/telemetry.go:130–137  ·  view source on GitHub ↗

createGlobalTracerProvider creates a new TracerProvider from the initialized DockerCli struct with the given options and sets it as the global tracer provider

(ctx context.Context, opts ...sdktrace.TracerProviderOption)

Source from the content-addressed store, hash-verified

128// createGlobalTracerProvider creates a new TracerProvider from the initialized DockerCli struct
129// with the given options and sets it as the global tracer provider
130func (cli *DockerCli) createGlobalTracerProvider(ctx context.Context, opts ...sdktrace.TracerProviderOption) {
131 allOpts := make([]sdktrace.TracerProviderOption, 0, len(opts)+2)
132 allOpts = append(allOpts, sdktrace.WithResource(cli.Resource()))
133 allOpts = append(allOpts, dockerSpanExporter(ctx, cli)...)
134 allOpts = append(allOpts, opts...)
135 tp := sdktrace.NewTracerProvider(allOpts...)
136 otel.SetTracerProvider(tp)
137}
138
139func defaultResourceOptions() []resource.Option {
140 return []resource.Option{

Callers 1

InitializeMethod · 0.95

Calls 2

ResourceMethod · 0.95
dockerSpanExporterFunction · 0.85

Tested by

no test coverage detected